Update to 1.15.2

This commit is contained in:
Reno 2020-07-22 05:30:03 +00:00
parent afda272458
commit 5e2a724cda
2288 changed files with 53312 additions and 52791 deletions

13427
client.txt

File diff suppressed because it is too large Load Diff

View File

@ -88,8 +88,8 @@ public class Channel {
return this.getState() == 4116; return this.getState() == 4116;
} }
public void setSelfPosition(final Vec3 cvi) { public void setSelfPosition(final Vec3 cvl) {
AL10.alSourcefv(this.source, 4100, new float[] { (float)cvi.x, (float)cvi.y, (float)cvi.z }); AL10.alSourcefv(this.source, 4100, new float[] { (float)cvl.x, (float)cvl.y, (float)cvl.z });
} }
public void setPitch(final float float1) { public void setPitch(final float float1) {
@ -119,13 +119,13 @@ public class Channel {
AL10.alSourcei(this.source, 514, (int)(boolean1 ? 1 : 0)); AL10.alSourcei(this.source, 514, (int)(boolean1 ? 1 : 0));
} }
public void attachStaticBuffer(final SoundBuffer cwu) { public void attachStaticBuffer(final SoundBuffer cwx) {
cwu.getAlBuffer().ifPresent(integer -> AL10.alSourcei(this.source, 4105, integer)); cwx.getAlBuffer().ifPresent(integer -> AL10.alSourcei(this.source, 4105, integer));
} }
public void attachBufferStream(final AudioStream edp) { public void attachBufferStream(final AudioStream eds) {
this.stream = edp; this.stream = eds;
final AudioFormat audioFormat3 = edp.getFormat(); final AudioFormat audioFormat3 = eds.getFormat();
this.streamingBufferSize = calculateBufferSize(audioFormat3, 1); this.streamingBufferSize = calculateBufferSize(audioFormat3, 1);
this.pumpBuffers(4); this.pumpBuffers(4);
} }

View File

@ -113,8 +113,8 @@ public class Library {
return ((c == Pool.STREAMING) ? this.streamingChannels : this.staticChannels).acquire(); return ((c == Pool.STREAMING) ? this.streamingChannels : this.staticChannels).acquire();
} }
public void releaseChannel(final Channel cwp) { public void releaseChannel(final Channel cws) {
if (!this.staticChannels.release(cwp) && !this.streamingChannels.release(cwp)) { if (!this.staticChannels.release(cws) && !this.streamingChannels.release(cws)) {
throw new IllegalStateException("Tried to release unknown channel"); throw new IllegalStateException("Tried to release unknown channel");
} }
} }
@ -133,7 +133,7 @@ public class Library {
} }
@Override @Override
public boolean release(final Channel cwp) { public boolean release(final Channel cws) {
return false; return false;
} }
@ -173,19 +173,19 @@ public class Library {
if (this.activeChannels.size() >= this.limit) { if (this.activeChannels.size() >= this.limit) {
return null; return null;
} }
final Channel cwp2 = Channel.create(); final Channel cws2 = Channel.create();
if (cwp2 != null) { if (cws2 != null) {
this.activeChannels.add(cwp2); this.activeChannels.add(cws2);
} }
return cwp2; return cws2;
} }
@Override @Override
public boolean release(final Channel cwp) { public boolean release(final Channel cws) {
if (!this.activeChannels.remove(cwp)) { if (!this.activeChannels.remove(cws)) {
return false; return false;
} }
cwp.destroy(); cws.destroy();
return true; return true;
} }
@ -210,7 +210,7 @@ public class Library {
@Nullable @Nullable
Channel acquire(); Channel acquire();
boolean release(final Channel cwp); boolean release(final Channel cws);
void cleanup(); void cleanup();

View File

@ -11,8 +11,8 @@ public class Listener {
this.gain = 1.0f; this.gain = 1.0f;
} }
public void setListenerPosition(final Vec3 cvi) { public void setListenerPosition(final Vec3 cvl) {
AL10.alListener3f(4100, (float)cvi.x, (float)cvi.y, (float)cvi.z); AL10.alListener3f(4100, (float)cvl.x, (float)cvl.y, (float)cvl.z);
} }
public void setListenerOrientation(final Vector3f e1, final Vector3f e2) { public void setListenerOrientation(final Vector3f e1, final Vector3f e2) {

View File

@ -1,9 +1,8 @@
package com.mojang.blaze3d.font; package com.mojang.blaze3d.font;
import com.mojang.blaze3d.platform.NativeImage; import com.mojang.blaze3d.platform.NativeImage;
import org.apache.logging.log4j.LogManager; import java.nio.Buffer;
import java.io.IOException; import org.lwjgl.system.MemoryUtil;
import java.nio.ByteBuffer;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.nio.IntBuffer; import java.nio.IntBuffer;
import org.lwjgl.system.MemoryStack; import org.lwjgl.system.MemoryStack;
@ -11,10 +10,10 @@ import org.lwjgl.stb.STBTruetype;
import it.unimi.dsi.fastutil.chars.CharArraySet; import it.unimi.dsi.fastutil.chars.CharArraySet;
import it.unimi.dsi.fastutil.chars.CharSet; import it.unimi.dsi.fastutil.chars.CharSet;
import org.lwjgl.stb.STBTTFontinfo; import org.lwjgl.stb.STBTTFontinfo;
import org.apache.logging.log4j.Logger; import java.nio.ByteBuffer;
public class TrueTypeGlyphProvider implements GlyphProvider { public class TrueTypeGlyphProvider implements GlyphProvider {
private static final Logger LOGGER; private final ByteBuffer fontMemory;
private final STBTTFontinfo font; private final STBTTFontinfo font;
private final float oversample; private final float oversample;
private final CharSet skip; private final CharSet skip;
@ -23,20 +22,21 @@ public class TrueTypeGlyphProvider implements GlyphProvider {
private final float pointScale; private final float pointScale;
private final float ascent; private final float ascent;
public TrueTypeGlyphProvider(final STBTTFontinfo sTBTTFontinfo, final float float2, final float float3, final float float4, final float float5, final String string) { public TrueTypeGlyphProvider(final ByteBuffer byteBuffer, final STBTTFontinfo sTBTTFontinfo, final float float3, final float float4, final float float5, final float float6, final String string) {
this.skip = (CharSet)new CharArraySet(); this.skip = (CharSet)new CharArraySet();
this.fontMemory = byteBuffer;
this.font = sTBTTFontinfo; this.font = sTBTTFontinfo;
this.oversample = float3; this.oversample = float4;
string.chars().forEach(integer -> this.skip.add((char)(integer & 0xFFFF))); string.chars().forEach(integer -> this.skip.add((char)(integer & 0xFFFF)));
this.shiftX = float4 * float3; this.shiftX = float5 * float4;
this.shiftY = float5 * float3; this.shiftY = float6 * float4;
this.pointScale = STBTruetype.stbtt_ScaleForPixelHeight(sTBTTFontinfo, float2 * float3); this.pointScale = STBTruetype.stbtt_ScaleForPixelHeight(sTBTTFontinfo, float3 * float4);
try (final MemoryStack memoryStack8 = MemoryStack.stackPush()) { try (final MemoryStack memoryStack9 = MemoryStack.stackPush()) {
final IntBuffer intBuffer10 = memoryStack8.mallocInt(1); final IntBuffer intBuffer11 = memoryStack9.mallocInt(1);
final IntBuffer intBuffer11 = memoryStack8.mallocInt(1); final IntBuffer intBuffer12 = memoryStack9.mallocInt(1);
final IntBuffer intBuffer12 = memoryStack8.mallocInt(1); final IntBuffer intBuffer13 = memoryStack9.mallocInt(1);
STBTruetype.stbtt_GetFontVMetrics(sTBTTFontinfo, intBuffer10, intBuffer11, intBuffer12); STBTruetype.stbtt_GetFontVMetrics(sTBTTFontinfo, intBuffer11, intBuffer12, intBuffer13);
this.ascent = intBuffer10.get(0) * this.pointScale; this.ascent = intBuffer11.get(0) * this.pointScale;
} }
} }
@ -68,16 +68,10 @@ public class TrueTypeGlyphProvider implements GlyphProvider {
} }
} }
public static STBTTFontinfo getStbttFontinfo(final ByteBuffer byteBuffer) throws IOException { @Override
final STBTTFontinfo sTBTTFontinfo2 = STBTTFontinfo.create(); public void close() {
if (!STBTruetype.stbtt_InitFont(sTBTTFontinfo2, byteBuffer)) { this.font.free();
throw new IOException("Invalid ttf"); MemoryUtil.memFree((Buffer)this.fontMemory);
}
return sTBTTFontinfo2;
}
static {
LOGGER = LogManager.getLogger();
} }
class Glyph implements RawGlyph { class Glyph implements RawGlyph {
@ -129,9 +123,9 @@ public class TrueTypeGlyphProvider implements GlyphProvider {
@Override @Override
public void upload(final int integer1, final int integer2) { public void upload(final int integer1, final int integer2) {
final NativeImage cxo4 = new NativeImage(NativeImage.Format.LUMINANCE, this.width, this.height, false); final NativeImage cxr4 = new NativeImage(NativeImage.Format.LUMINANCE, this.width, this.height, false);
cxo4.copyFromFont(TrueTypeGlyphProvider.this.font, this.index, this.width, this.height, TrueTypeGlyphProvider.this.pointScale, TrueTypeGlyphProvider.this.pointScale, TrueTypeGlyphProvider.this.shiftX, TrueTypeGlyphProvider.this.shiftY, 0, 0); cxr4.copyFromFont(TrueTypeGlyphProvider.this.font, this.index, this.width, this.height, TrueTypeGlyphProvider.this.pointScale, TrueTypeGlyphProvider.this.pointScale, TrueTypeGlyphProvider.this.shiftX, TrueTypeGlyphProvider.this.shiftY, 0, 0);
cxo4.upload(0, integer1, integer2, 0, 0, this.width, this.height, false, true); cxr4.upload(0, integer1, integer2, 0, 0, this.width, this.height, false, true);
} }
@Override @Override

View File

@ -212,14 +212,14 @@ public class RenderTarget {
final float float6 = (float)integer2; final float float6 = (float)integer2;
final float float7 = this.viewWidth / (float)this.width; final float float7 = this.viewWidth / (float)this.width;
final float float8 = this.viewHeight / (float)this.height; final float float8 = this.viewHeight / (float)this.height;
final Tesselator cyj9 = RenderSystem.renderThreadTesselator(); final Tesselator cym9 = RenderSystem.renderThreadTesselator();
final BufferBuilder cyd10 = cyj9.getBuilder(); final BufferBuilder cyg10 = cym9.getBuilder();
cyd10.begin(7, DefaultVertexFormat.POSITION_TEX_COLOR); cyg10.begin(7, DefaultVertexFormat.POSITION_TEX_COLOR);
cyd10.vertex(0.0, float6, 0.0).uv(0.0f, 0.0f).color(255, 255, 255, 255).endVertex(); cyg10.vertex(0.0, float6, 0.0).uv(0.0f, 0.0f).color(255, 255, 255, 255).endVertex();
cyd10.vertex(float5, float6, 0.0).uv(float7, 0.0f).color(255, 255, 255, 255).endVertex(); cyg10.vertex(float5, float6, 0.0).uv(float7, 0.0f).color(255, 255, 255, 255).endVertex();
cyd10.vertex(float5, 0.0, 0.0).uv(float7, float8).color(255, 255, 255, 255).endVertex(); cyg10.vertex(float5, 0.0, 0.0).uv(float7, float8).color(255, 255, 255, 255).endVertex();
cyd10.vertex(0.0, 0.0, 0.0).uv(0.0f, float8).color(255, 255, 255, 255).endVertex(); cyg10.vertex(0.0, 0.0, 0.0).uv(0.0f, float8).color(255, 255, 255, 255).endVertex();
cyj9.end(); cym9.end();
this.unbindRead(); this.unbindRead();
GlStateManager._depthMask(true); GlStateManager._depthMask(true);
GlStateManager._colorMask(true, true, true, true); GlStateManager._colorMask(true, true, true, true);

View File

@ -1,17 +1,20 @@
package com.mojang.blaze3d.platform; package com.mojang.blaze3d.platform;
import java.nio.Buffer;
import org.lwjgl.system.MemoryUtil; import org.lwjgl.system.MemoryUtil;
import com.google.common.base.Charsets;
import org.lwjgl.glfw.GLFWErrorCallback; import org.lwjgl.glfw.GLFWErrorCallback;
import net.minecraft.SharedConstants; import net.minecraft.SharedConstants;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWErrorCallbackI; import org.lwjgl.glfw.GLFWErrorCallbackI;
import org.lwjgl.BufferUtils;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
public class ClipboardManager { public class ClipboardManager {
private final ByteBuffer clipboardScratchBuffer; private final ByteBuffer clipboardScratchBuffer;
public ClipboardManager() { public ClipboardManager() {
this.clipboardScratchBuffer = ByteBuffer.allocateDirect(1024); this.clipboardScratchBuffer = BufferUtils.createByteBuffer(8192);
} }
public String getClipboard(final long long1, final GLFWErrorCallbackI gLFWErrorCallbackI) { public String getClipboard(final long long1, final GLFWErrorCallbackI gLFWErrorCallbackI) {
@ -25,20 +28,28 @@ public class ClipboardManager {
return string6; return string6;
} }
private void setClipboard(final long long1, final ByteBuffer byteBuffer, final String string) { private static void pushClipboard(final long long1, final ByteBuffer byteBuffer, final byte[] arr) {
MemoryUtil.memUTF8((CharSequence)string, true, byteBuffer); byteBuffer.clear();
byteBuffer.put(arr);
byteBuffer.put((byte)0);
byteBuffer.flip();
GLFW.glfwSetClipboardString(long1, byteBuffer); GLFW.glfwSetClipboardString(long1, byteBuffer);
} }
public void setClipboard(final long long1, final String string) { public void setClipboard(final long long1, final String string) {
final int integer5 = MemoryUtil.memLengthUTF8((CharSequence)string, true); final byte[] arr5 = string.getBytes(Charsets.UTF_8);
if (integer5 < this.clipboardScratchBuffer.capacity()) { final int integer6 = arr5.length + 1;
this.setClipboard(long1, this.clipboardScratchBuffer, string); if (integer6 < this.clipboardScratchBuffer.capacity()) {
this.clipboardScratchBuffer.clear(); pushClipboard(long1, this.clipboardScratchBuffer, arr5);
} }
else { else {
final ByteBuffer byteBuffer6 = ByteBuffer.allocateDirect(integer5); final ByteBuffer byteBuffer7 = MemoryUtil.memAlloc(integer6);
this.setClipboard(long1, byteBuffer6, string); try {
pushClipboard(long1, byteBuffer7, arr5);
}
finally {
MemoryUtil.memFree((Buffer)byteBuffer7);
}
} }
} }
} }

View File

@ -41,9 +41,9 @@ public class GLX {
return GlStateManager._getString(7937) + " GL version " + GlStateManager._getString(7938) + ", " + GlStateManager._getString(7936); return GlStateManager._getString(7937) + " GL version " + GlStateManager._getString(7938) + ", " + GlStateManager._getString(7936);
} }
public static int _getRefreshRate(final Window cxu) { public static int _getRefreshRate(final Window cxx) {
RenderSystem.assertThread(RenderSystem::isOnRenderThread); RenderSystem.assertThread(RenderSystem::isOnRenderThread);
long long2 = GLFW.glfwGetWindowMonitor(cxu.getWindow()); long long2 = GLFW.glfwGetWindowMonitor(cxx.getWindow());
if (long2 == 0L) { if (long2 == 0L) {
long2 = GLFW.glfwGetPrimaryMonitor(); long2 = GLFW.glfwGetPrimaryMonitor();
} }
@ -84,8 +84,8 @@ public class GLX {
} }
} }
public static boolean _shouldClose(final Window cxu) { public static boolean _shouldClose(final Window cxx) {
return GLFW.glfwWindowShouldClose(cxu.getWindow()); return GLFW.glfwWindowShouldClose(cxx.getWindow());
} }
public static void _setupNvFogDistance() { public static void _setupNvFogDistance() {
@ -119,38 +119,38 @@ public class GLX {
RenderSystem.assertThread(RenderSystem::isOnRenderThread); RenderSystem.assertThread(RenderSystem::isOnRenderThread);
GlStateManager._disableTexture(); GlStateManager._disableTexture();
GlStateManager._depthMask(false); GlStateManager._depthMask(false);
final Tesselator cyj5 = RenderSystem.renderThreadTesselator(); final Tesselator cym5 = RenderSystem.renderThreadTesselator();
final BufferBuilder cyd6 = cyj5.getBuilder(); final BufferBuilder cyg6 = cym5.getBuilder();
GL11.glLineWidth(4.0f); GL11.glLineWidth(4.0f);
cyd6.begin(1, DefaultVertexFormat.POSITION_COLOR); cyg6.begin(1, DefaultVertexFormat.POSITION_COLOR);
if (boolean2) { if (boolean2) {
cyd6.vertex(0.0, 0.0, 0.0).color(0, 0, 0, 255).endVertex(); cyg6.vertex(0.0, 0.0, 0.0).color(0, 0, 0, 255).endVertex();
cyd6.vertex(integer, 0.0, 0.0).color(0, 0, 0, 255).endVertex(); cyg6.vertex(integer, 0.0, 0.0).color(0, 0, 0, 255).endVertex();
} }
if (boolean3) { if (boolean3) {
cyd6.vertex(0.0, 0.0, 0.0).color(0, 0, 0, 255).endVertex(); cyg6.vertex(0.0, 0.0, 0.0).color(0, 0, 0, 255).endVertex();
cyd6.vertex(0.0, integer, 0.0).color(0, 0, 0, 255).endVertex(); cyg6.vertex(0.0, integer, 0.0).color(0, 0, 0, 255).endVertex();
} }
if (boolean4) { if (boolean4) {
cyd6.vertex(0.0, 0.0, 0.0).color(0, 0, 0, 255).endVertex(); cyg6.vertex(0.0, 0.0, 0.0).color(0, 0, 0, 255).endVertex();
cyd6.vertex(0.0, 0.0, integer).color(0, 0, 0, 255).endVertex(); cyg6.vertex(0.0, 0.0, integer).color(0, 0, 0, 255).endVertex();
} }
cyj5.end(); cym5.end();
GL11.glLineWidth(2.0f); GL11.glLineWidth(2.0f);
cyd6.begin(1, DefaultVertexFormat.POSITION_COLOR); cyg6.begin(1, DefaultVertexFormat.POSITION_COLOR);
if (boolean2) { if (boolean2) {
cyd6.vertex(0.0, 0.0, 0.0).color(255, 0, 0, 255).endVertex(); cyg6.vertex(0.0, 0.0, 0.0).color(255, 0, 0, 255).endVertex();
cyd6.vertex(integer, 0.0, 0.0).color(255, 0, 0, 255).endVertex(); cyg6.vertex(integer, 0.0, 0.0).color(255, 0, 0, 255).endVertex();
} }
if (boolean3) { if (boolean3) {
cyd6.vertex(0.0, 0.0, 0.0).color(0, 255, 0, 255).endVertex(); cyg6.vertex(0.0, 0.0, 0.0).color(0, 255, 0, 255).endVertex();
cyd6.vertex(0.0, integer, 0.0).color(0, 255, 0, 255).endVertex(); cyg6.vertex(0.0, integer, 0.0).color(0, 255, 0, 255).endVertex();
} }
if (boolean4) { if (boolean4) {
cyd6.vertex(0.0, 0.0, 0.0).color(127, 127, 255, 255).endVertex(); cyg6.vertex(0.0, 0.0, 0.0).color(127, 127, 255, 255).endVertex();
cyd6.vertex(0.0, 0.0, integer).color(127, 127, 255, 255).endVertex(); cyg6.vertex(0.0, 0.0, integer).color(127, 127, 255, 255).endVertex();
} }
cyj5.end(); cym5.end();
GL11.glLineWidth(1.0f); GL11.glLineWidth(1.0f);
GlStateManager._depthMask(true); GlStateManager._depthMask(true);
GlStateManager._enableTexture(); GlStateManager._enableTexture();

View File

@ -27,9 +27,9 @@ public final class Monitor {
final GLFWVidMode.Buffer buffer2 = GLFW.glfwGetVideoModes(this.monitor); final GLFWVidMode.Buffer buffer2 = GLFW.glfwGetVideoModes(this.monitor);
for (int integer3 = buffer2.limit() - 1; integer3 >= 0; --integer3) { for (int integer3 = buffer2.limit() - 1; integer3 >= 0; --integer3) {
buffer2.position(integer3); buffer2.position(integer3);
final VideoMode cxt4 = new VideoMode(buffer2); final VideoMode cxw4 = new VideoMode(buffer2);
if (cxt4.getRedBits() >= 8 && cxt4.getGreenBits() >= 8 && cxt4.getBlueBits() >= 8) { if (cxw4.getRedBits() >= 8 && cxw4.getGreenBits() >= 8 && cxw4.getBlueBits() >= 8) {
this.videoModes.add(cxt4); this.videoModes.add(cxw4);
} }
} }
final int[] arr3 = { 0 }; final int[] arr3 = { 0 };
@ -44,19 +44,19 @@ public final class Monitor {
public VideoMode getPreferredVidMode(final Optional<VideoMode> optional) { public VideoMode getPreferredVidMode(final Optional<VideoMode> optional) {
RenderSystem.assertThread(RenderSystem::isInInitPhase); RenderSystem.assertThread(RenderSystem::isInInitPhase);
if (optional.isPresent()) { if (optional.isPresent()) {
final VideoMode cxt3 = optional.get(); final VideoMode cxw3 = optional.get();
for (final VideoMode cxt4 : this.videoModes) { for (final VideoMode cxw4 : this.videoModes) {
if (cxt4.equals(cxt3)) { if (cxw4.equals(cxw3)) {
return cxt4; return cxw4;
} }
} }
} }
return this.getCurrentMode(); return this.getCurrentMode();
} }
public int getVideoModeIndex(final VideoMode cxt) { public int getVideoModeIndex(final VideoMode cxw) {
RenderSystem.assertThread(RenderSystem::isInInitPhase); RenderSystem.assertThread(RenderSystem::isInInitPhase);
return this.videoModes.indexOf(cxt); return this.videoModes.indexOf(cxw);
} }
public VideoMode getCurrentMode() { public VideoMode getCurrentMode() {

View File

@ -3,6 +3,7 @@ package com.mojang.blaze3d.platform;
import org.lwjgl.stb.STBIWriteCallback; import org.lwjgl.stb.STBIWriteCallback;
import java.util.EnumSet; import java.util.EnumSet;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import com.google.common.base.Charsets;
import java.util.Base64; import java.util.Base64;
import org.lwjgl.stb.STBImageResize; import org.lwjgl.stb.STBImageResize;
import org.lwjgl.stb.STBImageWrite; import org.lwjgl.stb.STBImageWrite;
@ -368,22 +369,22 @@ public final class NativeImage implements AutoCloseable {
} }
} }
public void copyFrom(final NativeImage cxo) { public void copyFrom(final NativeImage cxr) {
if (cxo.format() != this.format) { if (cxr.format() != this.format) {
throw new UnsupportedOperationException("Image formats don't match."); throw new UnsupportedOperationException("Image formats don't match.");
} }
final int integer3 = this.format.components(); final int integer3 = this.format.components();
this.checkAllocated(); this.checkAllocated();
cxo.checkAllocated(); cxr.checkAllocated();
if (this.width == cxo.width) { if (this.width == cxr.width) {
MemoryUtil.memCopy(cxo.pixels, this.pixels, Math.min(this.size, cxo.size)); MemoryUtil.memCopy(cxr.pixels, this.pixels, Math.min(this.size, cxr.size));
} }
else { else {
final int integer4 = Math.min(this.getWidth(), cxo.getWidth()); final int integer4 = Math.min(this.getWidth(), cxr.getWidth());
for (int integer5 = Math.min(this.getHeight(), cxo.getHeight()), integer6 = 0; integer6 < integer5; ++integer6) { for (int integer5 = Math.min(this.getHeight(), cxr.getHeight()), integer6 = 0; integer6 < integer5; ++integer6) {
final int integer7 = integer6 * cxo.getWidth() * integer3; final int integer7 = integer6 * cxr.getWidth() * integer3;
final int integer8 = integer6 * this.getWidth() * integer3; final int integer8 = integer6 * this.getWidth() * integer3;
MemoryUtil.memCopy(cxo.pixels + integer7, this.pixels + integer8, (long)integer4); MemoryUtil.memCopy(cxr.pixels + integer7, this.pixels + integer8, (long)integer4);
} }
} }
} }
@ -423,13 +424,13 @@ public final class NativeImage implements AutoCloseable {
} }
} }
public void resizeSubRectTo(final int integer1, final int integer2, final int integer3, final int integer4, final NativeImage cxo) { public void resizeSubRectTo(final int integer1, final int integer2, final int integer3, final int integer4, final NativeImage cxr) {
this.checkAllocated(); this.checkAllocated();
if (cxo.format() != this.format) { if (cxr.format() != this.format) {
throw new UnsupportedOperationException("resizeSubRectTo only works for images of the same format."); throw new UnsupportedOperationException("resizeSubRectTo only works for images of the same format.");
} }
final int integer5 = this.format.components(); final int integer5 = this.format.components();
STBImageResize.nstbir_resize_uint8(this.pixels + (integer1 + integer2 * this.getWidth()) * integer5, integer3, integer4, this.getWidth() * integer5, cxo.pixels, cxo.getWidth(), cxo.getHeight(), 0, integer5); STBImageResize.nstbir_resize_uint8(this.pixels + (integer1 + integer2 * this.getWidth()) * integer5, integer3, integer4, this.getWidth() * integer5, cxr.pixels, cxr.getWidth(), cxr.getHeight(), 0, integer5);
} }
public void untrack() { public void untrack() {
@ -437,13 +438,12 @@ public final class NativeImage implements AutoCloseable {
} }
public static NativeImage fromBase64(final String string) throws IOException { public static NativeImage fromBase64(final String string) throws IOException {
try (final MemoryStack memoryStack2 = MemoryStack.stackPush()) { final byte[] arr2 = Base64.getDecoder().decode(string.replaceAll("\n", "").getBytes(Charsets.UTF_8));
final ByteBuffer byteBuffer4 = memoryStack2.UTF8((CharSequence)string.replaceAll("\n", ""), false); try (final MemoryStack memoryStack3 = MemoryStack.stackPush()) {
final ByteBuffer byteBuffer5 = Base64.getDecoder().decode(byteBuffer4); final ByteBuffer byteBuffer5 = memoryStack3.malloc(arr2.length);
final ByteBuffer byteBuffer6 = memoryStack2.malloc(byteBuffer5.remaining()); byteBuffer5.put(arr2);
byteBuffer6.put(byteBuffer5); byteBuffer5.rewind();
byteBuffer6.rewind(); return read(byteBuffer5);
return read(byteBuffer6);
} }
} }

View File

@ -14,16 +14,16 @@ public class ScreenManager {
private final Long2ObjectMap<Monitor> monitors; private final Long2ObjectMap<Monitor> monitors;
private final MonitorCreator monitorCreator; private final MonitorCreator monitorCreator;
public ScreenManager(final MonitorCreator cxn) { public ScreenManager(final MonitorCreator cxq) {
this.monitors = (Long2ObjectMap<Monitor>)new Long2ObjectOpenHashMap(); this.monitors = (Long2ObjectMap<Monitor>)new Long2ObjectOpenHashMap();
RenderSystem.assertThread(RenderSystem::isInInitPhase); RenderSystem.assertThread(RenderSystem::isInInitPhase);
this.monitorCreator = cxn; this.monitorCreator = cxq;
GLFW.glfwSetMonitorCallback(this::onMonitorChange); GLFW.glfwSetMonitorCallback(this::onMonitorChange);
final PointerBuffer pointerBuffer3 = GLFW.glfwGetMonitors(); final PointerBuffer pointerBuffer3 = GLFW.glfwGetMonitors();
if (pointerBuffer3 != null) { if (pointerBuffer3 != null) {
for (int integer4 = 0; integer4 < pointerBuffer3.limit(); ++integer4) { for (int integer4 = 0; integer4 < pointerBuffer3.limit(); ++integer4) {
final long long5 = pointerBuffer3.get(integer4); final long long5 = pointerBuffer3.get(integer4);
this.monitors.put(long5, cxn.createMonitor(long5)); this.monitors.put(long5, cxq.createMonitor(long5));
} }
} }
} }
@ -45,22 +45,22 @@ public class ScreenManager {
} }
@Nullable @Nullable
public Monitor findBestMonitor(final Window cxu) { public Monitor findBestMonitor(final Window cxx) {
final long long3 = GLFW.glfwGetWindowMonitor(cxu.getWindow()); final long long3 = GLFW.glfwGetWindowMonitor(cxx.getWindow());
if (long3 != 0L) { if (long3 != 0L) {
return this.getMonitor(long3); return this.getMonitor(long3);
} }
final int integer5 = cxu.getX(); final int integer5 = cxx.getX();
final int integer6 = integer5 + cxu.getScreenWidth(); final int integer6 = integer5 + cxx.getScreenWidth();
final int integer7 = cxu.getY(); final int integer7 = cxx.getY();
final int integer8 = integer7 + cxu.getScreenHeight(); final int integer8 = integer7 + cxx.getScreenHeight();
int integer9 = -1; int integer9 = -1;
Monitor cxm10 = null; Monitor cxp10 = null;
for (final Monitor cxm11 : this.monitors.values()) { for (final Monitor cxp11 : this.monitors.values()) {
final int integer10 = cxm11.getX(); final int integer10 = cxp11.getX();
final int integer11 = integer10 + cxm11.getCurrentMode().getWidth(); final int integer11 = integer10 + cxp11.getCurrentMode().getWidth();
final int integer12 = cxm11.getY(); final int integer12 = cxp11.getY();
final int integer13 = integer12 + cxm11.getCurrentMode().getHeight(); final int integer13 = integer12 + cxp11.getCurrentMode().getHeight();
final int integer14 = clamp(integer5, integer10, integer11); final int integer14 = clamp(integer5, integer10, integer11);
final int integer15 = clamp(integer6, integer10, integer11); final int integer15 = clamp(integer6, integer10, integer11);
final int integer16 = clamp(integer7, integer12, integer13); final int integer16 = clamp(integer7, integer12, integer13);
@ -69,11 +69,11 @@ public class ScreenManager {
final int integer19 = Math.max(0, integer17 - integer16); final int integer19 = Math.max(0, integer17 - integer16);
final int integer20 = integer18 * integer19; final int integer20 = integer18 * integer19;
if (integer20 > integer9) { if (integer20 > integer9) {
cxm10 = cxm11; cxp10 = cxp11;
integer9 = integer20; integer9 = integer20;
} }
} }
return cxm10; return cxp10;
} }
public static int clamp(final int integer1, final int integer2, final int integer3) { public static int clamp(final int integer1, final int integer2, final int integer3) {

View File

@ -75,8 +75,8 @@ public final class VideoMode {
if (object == null || this.getClass() != object.getClass()) { if (object == null || this.getClass() != object.getClass()) {
return false; return false;
} }
final VideoMode cxt3 = (VideoMode)object; final VideoMode cxw3 = (VideoMode)object;
return this.width == cxt3.width && this.height == cxt3.height && this.redBits == cxt3.redBits && this.greenBits == cxt3.greenBits && this.blueBits == cxt3.blueBits && this.refreshRate == cxt3.refreshRate; return this.width == cxw3.width && this.height == cxw3.height && this.redBits == cxw3.redBits && this.greenBits == cxw3.greenBits && this.blueBits == cxw3.blueBits && this.refreshRate == cxw3.refreshRate;
} }
@Override @Override

View File

@ -52,32 +52,32 @@ public final class Window implements AutoCloseable {
private int framerateLimit; private int framerateLimit;
private boolean vsync; private boolean vsync;
public Window(final WindowEventHandler cxv, final ScreenManager cxq, final DisplayData cxe, @Nullable final String string4, final String string5) { public Window(final WindowEventHandler cxy, final ScreenManager cxt, final DisplayData cxh, @Nullable final String string4, final String string5) {
this.defaultErrorCallback = GLFWErrorCallback.create(this::defaultErrorCallback); this.defaultErrorCallback = GLFWErrorCallback.create(this::defaultErrorCallback);
this.errorSection = ""; this.errorSection = "";
RenderSystem.assertThread(RenderSystem::isInInitPhase); RenderSystem.assertThread(RenderSystem::isInInitPhase);
this.screenManager = cxq; this.screenManager = cxt;
this.setBootErrorCallback(); this.setBootErrorCallback();
this.setErrorSection("Pre startup"); this.setErrorSection("Pre startup");
this.eventHandler = cxv; this.eventHandler = cxy;
final Optional<VideoMode> optional7 = VideoMode.read(string4); final Optional<VideoMode> optional7 = VideoMode.read(string4);
if (optional7.isPresent()) { if (optional7.isPresent()) {
this.preferredFullscreenVideoMode = optional7; this.preferredFullscreenVideoMode = optional7;
} }
else if (cxe.fullscreenWidth.isPresent() && cxe.fullscreenHeight.isPresent()) { else if (cxh.fullscreenWidth.isPresent() && cxh.fullscreenHeight.isPresent()) {
this.preferredFullscreenVideoMode = Optional.<VideoMode>of(new VideoMode(cxe.fullscreenWidth.getAsInt(), cxe.fullscreenHeight.getAsInt(), 8, 8, 8, 60)); this.preferredFullscreenVideoMode = Optional.<VideoMode>of(new VideoMode(cxh.fullscreenWidth.getAsInt(), cxh.fullscreenHeight.getAsInt(), 8, 8, 8, 60));
} }
else { else {
this.preferredFullscreenVideoMode = Optional.<VideoMode>empty(); this.preferredFullscreenVideoMode = Optional.<VideoMode>empty();
} }
final boolean isFullscreen = cxe.isFullscreen; final boolean isFullscreen = cxh.isFullscreen;
this.fullscreen = isFullscreen; this.fullscreen = isFullscreen;
this.actuallyFullscreen = isFullscreen; this.actuallyFullscreen = isFullscreen;
final Monitor cxm8 = cxq.getMonitor(GLFW.glfwGetPrimaryMonitor()); final Monitor cxp8 = cxt.getMonitor(GLFW.glfwGetPrimaryMonitor());
final int n = (cxe.width > 0) ? cxe.width : 1; final int n = (cxh.width > 0) ? cxh.width : 1;
this.width = n; this.width = n;
this.windowedWidth = n; this.windowedWidth = n;
final int n2 = (cxe.height > 0) ? cxe.height : 1; final int n2 = (cxh.height > 0) ? cxh.height : 1;
this.height = n2; this.height = n2;
this.windowedHeight = n2; this.windowedHeight = n2;
GLFW.glfwDefaultWindowHints(); GLFW.glfwDefaultWindowHints();
@ -86,13 +86,13 @@ public final class Window implements AutoCloseable {
GLFW.glfwWindowHint(139266, 2); GLFW.glfwWindowHint(139266, 2);
GLFW.glfwWindowHint(139267, 0); GLFW.glfwWindowHint(139267, 0);
GLFW.glfwWindowHint(139272, 0); GLFW.glfwWindowHint(139272, 0);
this.window = GLFW.glfwCreateWindow(this.width, this.height, (CharSequence)string5, (this.fullscreen && cxm8 != null) ? cxm8.getMonitor() : 0L, 0L); this.window = GLFW.glfwCreateWindow(this.width, this.height, (CharSequence)string5, (this.fullscreen && cxp8 != null) ? cxp8.getMonitor() : 0L, 0L);
if (cxm8 != null) { if (cxp8 != null) {
final VideoMode cxt9 = cxm8.getPreferredVidMode(this.fullscreen ? this.preferredFullscreenVideoMode : Optional.<VideoMode>empty()); final VideoMode cxw9 = cxp8.getPreferredVidMode(this.fullscreen ? this.preferredFullscreenVideoMode : Optional.<VideoMode>empty());
final int n3 = cxm8.getX() + cxt9.getWidth() / 2 - this.width / 2; final int n3 = cxp8.getX() + cxw9.getWidth() / 2 - this.width / 2;
this.x = n3; this.x = n3;
this.windowedX = n3; this.windowedX = n3;
final int n4 = cxm8.getY() + cxt9.getHeight() / 2 - this.height / 2; final int n4 = cxp8.getY() + cxw9.getHeight() / 2 - this.height / 2;
this.y = n4; this.y = n4;
this.windowedY = n4; this.windowedY = n4;
} }
@ -320,13 +320,13 @@ public final class Window implements AutoCloseable {
RenderSystem.assertThread(RenderSystem::isInInitPhase); RenderSystem.assertThread(RenderSystem::isInInitPhase);
final boolean boolean2 = GLFW.glfwGetWindowMonitor(this.window) != 0L; final boolean boolean2 = GLFW.glfwGetWindowMonitor(this.window) != 0L;
if (this.fullscreen) { if (this.fullscreen) {
final Monitor cxm3 = this.screenManager.findBestMonitor(this); final Monitor cxp3 = this.screenManager.findBestMonitor(this);
if (cxm3 == null) { if (cxp3 == null) {
Window.LOGGER.warn("Failed to find suitable monitor for fullscreen mode"); Window.LOGGER.warn("Failed to find suitable monitor for fullscreen mode");
this.fullscreen = false; this.fullscreen = false;
} }
else { else {
final VideoMode cxt4 = cxm3.getPreferredVidMode(this.preferredFullscreenVideoMode); final VideoMode cxw4 = cxp3.getPreferredVidMode(this.preferredFullscreenVideoMode);
if (!boolean2) { if (!boolean2) {
this.windowedX = this.x; this.windowedX = this.x;
this.windowedY = this.y; this.windowedY = this.y;
@ -335,9 +335,9 @@ public final class Window implements AutoCloseable {
} }
this.x = 0; this.x = 0;
this.y = 0; this.y = 0;
this.width = cxt4.getWidth(); this.width = cxw4.getWidth();
this.height = cxt4.getHeight(); this.height = cxw4.getHeight();
GLFW.glfwSetWindowMonitor(this.window, cxm3.getMonitor(), this.x, this.y, this.width, this.height, cxt4.getRefreshRate()); GLFW.glfwSetWindowMonitor(this.window, cxp3.getMonitor(), this.x, this.y, this.width, this.height, cxw4.getRefreshRate());
} }
} }
else { else {
@ -383,6 +383,10 @@ public final class Window implements AutoCloseable {
this.guiScaledHeight = ((this.framebufferHeight / double1 > integer5) ? (integer5 + 1) : integer5); this.guiScaledHeight = ((this.framebufferHeight / double1 > integer5) ? (integer5 + 1) : integer5);
} }
public void setTitle(final String string) {
GLFW.glfwSetWindowTitle(this.window, (CharSequence)string);
}
public long getWindow() { public long getWindow() {
return this.window; return this.window;
} }

View File

@ -64,8 +64,8 @@ public class BlendMode {
if (!(object instanceof BlendMode)) { if (!(object instanceof BlendMode)) {
return false; return false;
} }
final BlendMode cxx3 = (BlendMode)object; final BlendMode cya3 = (BlendMode)object;
return this.blendFunc == cxx3.blendFunc && this.dstAlphaFactor == cxx3.dstAlphaFactor && this.dstColorFactor == cxx3.dstColorFactor && this.opaque == cxx3.opaque && this.separateBlend == cxx3.separateBlend && this.srcAlphaFactor == cxx3.srcAlphaFactor && this.srcColorFactor == cxx3.srcColorFactor; return this.blendFunc == cya3.blendFunc && this.dstAlphaFactor == cya3.dstAlphaFactor && this.dstColorFactor == cya3.dstColorFactor && this.opaque == cya3.opaque && this.separateBlend == cya3.separateBlend && this.srcAlphaFactor == cya3.srcAlphaFactor && this.srcColorFactor == cya3.srcColorFactor;
} }
@Override @Override

View File

@ -21,10 +21,10 @@ public class Program {
this.name = string; this.name = string;
} }
public void attachToEffect(final Effect cxy) { public void attachToEffect(final Effect cyb) {
RenderSystem.assertThread(RenderSystem::isOnRenderThread); RenderSystem.assertThread(RenderSystem::isOnRenderThread);
++this.references; ++this.references;
GlStateManager.glAttachShader(cxy.getId(), this.id); GlStateManager.glAttachShader(cyb.getId(), this.id);
} }
public void close() { public void close() {
@ -53,9 +53,9 @@ public class Program {
final String string3 = StringUtils.trim(GlStateManager.glGetShaderInfoLog(integer5, 32768)); final String string3 = StringUtils.trim(GlStateManager.glGetShaderInfoLog(integer5, 32768));
throw new IOException("Couldn't compile " + a.getName() + " program: " + string3); throw new IOException("Couldn't compile " + a.getName() + " program: " + string3);
} }
final Program cxz6 = new Program(a, integer5, string); final Program cyc6 = new Program(a, integer5, string);
a.getPrograms().put(string, cxz6); a.getPrograms().put(string, cyc6);
return cxz6; return cyc6;
} }
public enum Type { public enum Type {

View File

@ -14,11 +14,11 @@ public class ProgramManager {
GlStateManager._glUseProgram(integer); GlStateManager._glUseProgram(integer);
} }
public static void releaseProgram(final Effect cxy) { public static void releaseProgram(final Effect cyb) {
RenderSystem.assertThread(RenderSystem::isOnRenderThread); RenderSystem.assertThread(RenderSystem::isOnRenderThread);
cxy.getFragmentProgram().close(); cyb.getFragmentProgram().close();
cxy.getVertexProgram().close(); cyb.getVertexProgram().close();
GlStateManager.glDeleteProgram(cxy.getId()); GlStateManager.glDeleteProgram(cyb.getId());
} }
public static int createProgram() throws IOException { public static int createProgram() throws IOException {
@ -30,15 +30,15 @@ public class ProgramManager {
return integer1; return integer1;
} }
public static void linkProgram(final Effect cxy) throws IOException { public static void linkProgram(final Effect cyb) throws IOException {
RenderSystem.assertThread(RenderSystem::isOnRenderThread); RenderSystem.assertThread(RenderSystem::isOnRenderThread);
cxy.getFragmentProgram().attachToEffect(cxy); cyb.getFragmentProgram().attachToEffect(cyb);
cxy.getVertexProgram().attachToEffect(cxy); cyb.getVertexProgram().attachToEffect(cyb);
GlStateManager.glLinkProgram(cxy.getId()); GlStateManager.glLinkProgram(cyb.getId());
final int integer2 = GlStateManager.glGetProgrami(cxy.getId(), 35714); final int integer2 = GlStateManager.glGetProgrami(cyb.getId(), 35714);
if (integer2 == 0) { if (integer2 == 0) {
ProgramManager.LOGGER.warn("Error encountered when linking program containing VS {} and FS {}. Log output:", cxy.getVertexProgram().getName(), cxy.getFragmentProgram().getName()); ProgramManager.LOGGER.warn("Error encountered when linking program containing VS {} and FS {}. Log output:", cyb.getVertexProgram().getName(), cyb.getFragmentProgram().getName());
ProgramManager.LOGGER.warn(GlStateManager.glGetProgramInfoLog(cxy.getId(), 32768)); ProgramManager.LOGGER.warn(GlStateManager.glGetProgramInfoLog(cyb.getId(), 32768));
} }
} }

View File

@ -21,11 +21,11 @@ public class Uniform extends AbstractUniform implements AutoCloseable {
private boolean dirty; private boolean dirty;
private final Effect parent; private final Effect parent;
public Uniform(final String string, final int integer2, final int integer3, final Effect cxy) { public Uniform(final String string, final int integer2, final int integer3, final Effect cyb) {
this.name = string; this.name = string;
this.count = integer3; this.count = integer3;
this.type = integer2; this.type = integer2;
this.parent = cxy; this.parent = cyb;
if (integer2 <= 3) { if (integer2 <= 3) {
this.intValues = MemoryUtil.memAllocInt(integer3); this.intValues = MemoryUtil.memAllocInt(integer3);
this.floatValues = null; this.floatValues = null;

View File

@ -73,8 +73,8 @@ public class RenderSystem {
return true; return true;
} }
public static void recordRenderCall(final RenderCall cwz) { public static void recordRenderCall(final RenderCall cxc) {
RenderSystem.recordingQueue.add(cwz); RenderSystem.recordingQueue.add(cxc);
} }
public static void flipFrame(final long long1) { public static void flipFrame(final long long1) {
@ -88,8 +88,8 @@ public class RenderSystem {
public static void replayQueue() { public static void replayQueue() {
RenderSystem.isReplayingQueue = true; RenderSystem.isReplayingQueue = true;
while (!RenderSystem.recordingQueue.isEmpty()) { while (!RenderSystem.recordingQueue.isEmpty()) {
final RenderCall cwz1 = RenderSystem.recordingQueue.poll(); final RenderCall cxc1 = RenderSystem.recordingQueue.poll();
cwz1.execute(); cxc1.execute();
} }
RenderSystem.isReplayingQueue = false; RenderSystem.isReplayingQueue = false;
} }

View File

@ -20,8 +20,8 @@ public class BreakingTextureGenerator extends DefaultedVertexConsumer {
private float ny; private float ny;
private float nz; private float nz;
public BreakingTextureGenerator(final VertexConsumer cyl, final PoseStack.Pose a) { public BreakingTextureGenerator(final VertexConsumer cyo, final PoseStack.Pose a) {
this.delegate = cyl; this.delegate = cyo;
(this.cameraInversePose = a.pose().copy()).invert(); (this.cameraInversePose = a.pose().copy()).invert();
(this.normalPose = a.normal().copy()).invert(); (this.normalPose = a.normal().copy()).invert();
this.resetState(); this.resetState();

View File

@ -152,31 +152,31 @@ public class BufferBuilder extends DefaultedVertexConsumer implements BufferVert
this.buffer.position(this.totalRenderedBytes); this.buffer.position(this.totalRenderedBytes);
this.buffer.put(b.data); this.buffer.put(b.data);
this.buffer.clear(); this.buffer.clear();
final VertexFormat cym4 = b.format; final VertexFormat cyp4 = b.format;
this.switchFormat(cym4); this.switchFormat(cyp4);
this.vertices = integer3 / cym4.getVertexSize(); this.vertices = integer3 / cyp4.getVertexSize();
this.nextElementByte = this.totalRenderedBytes + this.vertices * cym4.getVertexSize(); this.nextElementByte = this.totalRenderedBytes + this.vertices * cyp4.getVertexSize();
} }
public void begin(final int integer, final VertexFormat cym) { public void begin(final int integer, final VertexFormat cyp) {
if (this.building) { if (this.building) {
throw new IllegalStateException("Already building!"); throw new IllegalStateException("Already building!");
} }
this.building = true; this.building = true;
this.mode = integer; this.mode = integer;
this.switchFormat(cym); this.switchFormat(cyp);
this.currentElement = cym.getElements().get(0); this.currentElement = cyp.getElements().get(0);
this.elementIndex = 0; this.elementIndex = 0;
this.buffer.clear(); this.buffer.clear();
} }
private void switchFormat(final VertexFormat cym) { private void switchFormat(final VertexFormat cyp) {
if (this.format == cym) { if (this.format == cyp) {
return; return;
} }
this.format = cym; this.format = cyp;
final boolean boolean3 = cym == DefaultVertexFormat.NEW_ENTITY; final boolean boolean3 = cyp == DefaultVertexFormat.NEW_ENTITY;
final boolean boolean4 = cym == DefaultVertexFormat.BLOCK; final boolean boolean4 = cyp == DefaultVertexFormat.BLOCK;
this.fastFormat = (boolean3 || boolean4); this.fastFormat = (boolean3 || boolean4);
this.fullFormat = boolean3; this.fullFormat = boolean3;
} }
@ -222,9 +222,9 @@ public class BufferBuilder extends DefaultedVertexConsumer implements BufferVert
final ImmutableList<VertexFormatElement> immutableList2 = this.format.getElements(); final ImmutableList<VertexFormatElement> immutableList2 = this.format.getElements();
this.elementIndex = (this.elementIndex + 1) % immutableList2.size(); this.elementIndex = (this.elementIndex + 1) % immutableList2.size();
this.nextElementByte += this.currentElement.getByteSize(); this.nextElementByte += this.currentElement.getByteSize();
final VertexFormatElement cyn3 = immutableList2.get(this.elementIndex); final VertexFormatElement cyq3 = immutableList2.get(this.elementIndex);
this.currentElement = cyn3; this.currentElement = cyq3;
if (cyn3.getUsage() == VertexFormatElement.Usage.PADDING) { if (cyq3.getUsage() == VertexFormatElement.Usage.PADDING) {
this.nextElement(); this.nextElement();
} }
if (this.defaultColorSet && this.currentElement.getUsage() == VertexFormatElement.Usage.COLOR) { if (this.defaultColorSet && this.currentElement.getUsage() == VertexFormatElement.Usage.COLOR) {
@ -324,9 +324,9 @@ public class BufferBuilder extends DefaultedVertexConsumer implements BufferVert
private final ByteBuffer data; private final ByteBuffer data;
private final VertexFormat format; private final VertexFormat format;
private State(final ByteBuffer byteBuffer, final VertexFormat cym) { private State(final ByteBuffer byteBuffer, final VertexFormat cyp) {
this.data = byteBuffer; this.data = byteBuffer;
this.format = cym; this.format = cyp;
} }
} }
@ -335,8 +335,8 @@ public class BufferBuilder extends DefaultedVertexConsumer implements BufferVert
private final int vertexCount; private final int vertexCount;
private final int mode; private final int mode;
private DrawState(final VertexFormat cym, final int integer2, final int integer3) { private DrawState(final VertexFormat cyp, final int integer2, final int integer3) {
this.format = cym; this.format = cyp;
this.vertexCount = integer2; this.vertexCount = integer2;
this.mode = integer3; this.mode = integer3;
} }

View File

@ -7,31 +7,31 @@ import java.nio.ByteBuffer;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
public class BufferUploader { public class BufferUploader {
public static void end(final BufferBuilder cyd) { public static void end(final BufferBuilder cyg) {
if (!RenderSystem.isOnRenderThread()) { if (!RenderSystem.isOnRenderThread()) {
final Pair<BufferBuilder.DrawState, ByteBuffer> pair2; final Pair<BufferBuilder.DrawState, ByteBuffer> pair2;
final BufferBuilder.DrawState a3; final BufferBuilder.DrawState a3;
RenderSystem.recordRenderCall(() -> { RenderSystem.recordRenderCall(() -> {
pair2 = cyd.popNextBuffer(); pair2 = cyg.popNextBuffer();
a3 = (BufferBuilder.DrawState)pair2.getFirst(); a3 = (BufferBuilder.DrawState)pair2.getFirst();
_end((ByteBuffer)pair2.getSecond(), a3.mode(), a3.format(), a3.vertexCount()); _end((ByteBuffer)pair2.getSecond(), a3.mode(), a3.format(), a3.vertexCount());
}); });
} }
else { else {
final Pair<BufferBuilder.DrawState, ByteBuffer> pair3 = cyd.popNextBuffer(); final Pair<BufferBuilder.DrawState, ByteBuffer> pair3 = cyg.popNextBuffer();
final BufferBuilder.DrawState a4 = (BufferBuilder.DrawState)pair3.getFirst(); final BufferBuilder.DrawState a4 = (BufferBuilder.DrawState)pair3.getFirst();
_end((ByteBuffer)pair3.getSecond(), a4.mode(), a4.format(), a4.vertexCount()); _end((ByteBuffer)pair3.getSecond(), a4.mode(), a4.format(), a4.vertexCount());
} }
} }
private static void _end(final ByteBuffer byteBuffer, final int integer2, final VertexFormat cym, final int integer4) { private static void _end(final ByteBuffer byteBuffer, final int integer2, final VertexFormat cyp, final int integer4) {
RenderSystem.assertThread(RenderSystem::isOnRenderThread); RenderSystem.assertThread(RenderSystem::isOnRenderThread);
byteBuffer.clear(); byteBuffer.clear();
if (integer4 <= 0) { if (integer4 <= 0) {
return; return;
} }
cym.setupBufferState(MemoryUtil.memAddress(byteBuffer)); cyp.setupBufferState(MemoryUtil.memAddress(byteBuffer));
GlStateManager._drawArrays(integer2, 0, integer4); GlStateManager._drawArrays(integer2, 0, integer4);
cym.clearBufferState(); cyp.clearBufferState();
} }
} }

View File

@ -25,11 +25,11 @@ public interface BufferVertexConsumer extends VertexConsumer {
} }
default VertexConsumer color(final int integer1, final int integer2, final int integer3, final int integer4) { default VertexConsumer color(final int integer1, final int integer2, final int integer3, final int integer4) {
final VertexFormatElement cyn6 = this.currentElement(); final VertexFormatElement cyq6 = this.currentElement();
if (cyn6.getUsage() != VertexFormatElement.Usage.COLOR) { if (cyq6.getUsage() != VertexFormatElement.Usage.COLOR) {
return this; return this;
} }
if (cyn6.getType() != VertexFormatElement.Type.UBYTE) { if (cyq6.getType() != VertexFormatElement.Type.UBYTE) {
throw new IllegalStateException(); throw new IllegalStateException();
} }
this.putByte(0, (byte)integer1); this.putByte(0, (byte)integer1);
@ -41,11 +41,11 @@ public interface BufferVertexConsumer extends VertexConsumer {
} }
default VertexConsumer uv(final float float1, final float float2) { default VertexConsumer uv(final float float1, final float float2) {
final VertexFormatElement cyn4 = this.currentElement(); final VertexFormatElement cyq4 = this.currentElement();
if (cyn4.getUsage() != VertexFormatElement.Usage.UV || cyn4.getIndex() != 0) { if (cyq4.getUsage() != VertexFormatElement.Usage.UV || cyq4.getIndex() != 0) {
return this; return this;
} }
if (cyn4.getType() != VertexFormatElement.Type.FLOAT) { if (cyq4.getType() != VertexFormatElement.Type.FLOAT) {
throw new IllegalStateException(); throw new IllegalStateException();
} }
this.putFloat(0, float1); this.putFloat(0, float1);
@ -63,11 +63,11 @@ public interface BufferVertexConsumer extends VertexConsumer {
} }
default VertexConsumer uvShort(final short short1, final short short2, final int integer) { default VertexConsumer uvShort(final short short1, final short short2, final int integer) {
final VertexFormatElement cyn5 = this.currentElement(); final VertexFormatElement cyq5 = this.currentElement();
if (cyn5.getUsage() != VertexFormatElement.Usage.UV || cyn5.getIndex() != integer) { if (cyq5.getUsage() != VertexFormatElement.Usage.UV || cyq5.getIndex() != integer) {
return this; return this;
} }
if (cyn5.getType() != VertexFormatElement.Type.SHORT) { if (cyq5.getType() != VertexFormatElement.Type.SHORT) {
throw new IllegalStateException(); throw new IllegalStateException();
} }
this.putShort(0, short1); this.putShort(0, short1);
@ -77,11 +77,11 @@ public interface BufferVertexConsumer extends VertexConsumer {
} }
default VertexConsumer normal(final float float1, final float float2, final float float3) { default VertexConsumer normal(final float float1, final float float2, final float float3) {
final VertexFormatElement cyn5 = this.currentElement(); final VertexFormatElement cyq5 = this.currentElement();
if (cyn5.getUsage() != VertexFormatElement.Usage.NORMAL) { if (cyq5.getUsage() != VertexFormatElement.Usage.NORMAL) {
return this; return this;
} }
if (cyn5.getType() != VertexFormatElement.Type.BYTE) { if (cyq5.getType() != VertexFormatElement.Type.BYTE) {
throw new IllegalStateException(); throw new IllegalStateException();
} }
this.putByte(0, normalIntValue(float1)); this.putByte(0, normalIntValue(float1));

View File

@ -33,7 +33,10 @@ public class PoseStack {
final Pose a5 = this.poseStack.getLast(); final Pose a5 = this.poseStack.getLast();
a5.pose.multiply(Matrix4f.createScaleMatrix(float1, float2, float3)); a5.pose.multiply(Matrix4f.createScaleMatrix(float1, float2, float3));
if (float1 == float2 && float2 == float3) { if (float1 == float2 && float2 == float3) {
return; if (float1 > 0.0f) {
return;
}
a5.normal.mul(-1.0f);
} }
final float float4 = 1.0f / float1; final float float4 = 1.0f / float1;
final float float5 = 1.0f / float2; final float float5 = 1.0f / float2;

View File

@ -11,8 +11,8 @@ public class VertexBuffer implements AutoCloseable {
private final VertexFormat format; private final VertexFormat format;
private int vertexCount; private int vertexCount;
public VertexBuffer(final VertexFormat cym) { public VertexBuffer(final VertexFormat cyp) {
this.format = cym; this.format = cyp;
RenderSystem.glGenBuffers(integer -> this.id = integer); RenderSystem.glGenBuffers(integer -> this.id = integer);
} }
@ -20,25 +20,25 @@ public class VertexBuffer implements AutoCloseable {
RenderSystem.glBindBuffer(34962, () -> this.id); RenderSystem.glBindBuffer(34962, () -> this.id);
} }
public void upload(final BufferBuilder cyd) { public void upload(final BufferBuilder cyg) {
if (!RenderSystem.isOnRenderThread()) { if (!RenderSystem.isOnRenderThread()) {
RenderSystem.recordRenderCall(() -> this.upload_(cyd)); RenderSystem.recordRenderCall(() -> this.upload_(cyg));
} }
else { else {
this.upload_(cyd); this.upload_(cyg);
} }
} }
public CompletableFuture<Void> uploadLater(final BufferBuilder cyd) { public CompletableFuture<Void> uploadLater(final BufferBuilder cyg) {
if (!RenderSystem.isOnRenderThread()) { if (!RenderSystem.isOnRenderThread()) {
return CompletableFuture.runAsync(() -> this.upload_(cyd), runnable -> RenderSystem.recordRenderCall(runnable::run)); return CompletableFuture.runAsync(() -> this.upload_(cyg), runnable -> RenderSystem.recordRenderCall(runnable::run));
} }
this.upload_(cyd); this.upload_(cyg);
return CompletableFuture.<Void>completedFuture((Void)null); return CompletableFuture.<Void>completedFuture((Void)null);
} }
private void upload_(final BufferBuilder cyd) { private void upload_(final BufferBuilder cyg) {
final Pair<BufferBuilder.DrawState, ByteBuffer> pair3 = cyd.popNextBuffer(); final Pair<BufferBuilder.DrawState, ByteBuffer> pair3 = cyg.popNextBuffer();
if (this.id == -1) { if (this.id == -1) {
return; return;
} }

View File

@ -51,13 +51,13 @@ public interface VertexConsumer {
return this.overlayCoords(integer & 0xFFFF, integer >> 16 & 0xFFFF); return this.overlayCoords(integer & 0xFFFF, integer >> 16 & 0xFFFF);
} }
default void putBulkData(final PoseStack.Pose a, final BakedQuad drk, final float float3, final float float4, final float float5, final int integer6, final int integer7) { default void putBulkData(final PoseStack.Pose a, final BakedQuad drn, final float float3, final float float4, final float float5, final int integer6, final int integer7) {
this.putBulkData(a, drk, new float[] { 1.0f, 1.0f, 1.0f, 1.0f }, float3, float4, float5, new int[] { integer6, integer6, integer6, integer6 }, integer7, false); this.putBulkData(a, drn, new float[] { 1.0f, 1.0f, 1.0f, 1.0f }, float3, float4, float5, new int[] { integer6, integer6, integer6, integer6 }, integer7, false);
} }
default void putBulkData(final PoseStack.Pose a, final BakedQuad drk, final float[] arr, final float float4, final float float5, final float float6, final int[] arr, final int integer, final boolean boolean9) { default void putBulkData(final PoseStack.Pose a, final BakedQuad drn, final float[] arr, final float float4, final float float5, final float float6, final int[] arr, final int integer, final boolean boolean9) {
final int[] arr2 = drk.getVertices(); final int[] arr2 = drn.getVertices();
final Vec3i gg12 = drk.getDirection().getNormal(); final Vec3i gg12 = drn.getDirection().getNormal();
final Vector3f e13 = new Vector3f((float)gg12.getX(), (float)gg12.getY(), (float)gg12.getZ()); final Vector3f e13 = new Vector3f((float)gg12.getX(), (float)gg12.getY(), (float)gg12.getZ());
final Matrix4f b14 = a.pose(); final Matrix4f b14 = a.pose();
e13.transform(a.normal()); e13.transform(a.normal());

View File

@ -19,9 +19,9 @@ public class VertexFormat {
this.offsets = (IntList)new IntArrayList(); this.offsets = (IntList)new IntArrayList();
this.elements = immutableList; this.elements = immutableList;
int integer3 = 0; int integer3 = 0;
for (final VertexFormatElement cyn5 : immutableList) { for (final VertexFormatElement cyq5 : immutableList) {
this.offsets.add(integer3); this.offsets.add(integer3);
integer3 += cyn5.getByteSize(); integer3 += cyq5.getByteSize();
} }
this.vertexSize = integer3; this.vertexSize = integer3;
} }
@ -51,8 +51,8 @@ public class VertexFormat {
if (object == null || this.getClass() != object.getClass()) { if (object == null || this.getClass() != object.getClass()) {
return false; return false;
} }
final VertexFormat cym3 = (VertexFormat)object; final VertexFormat cyp3 = (VertexFormat)object;
return this.vertexSize == cym3.vertexSize && this.elements.equals(cym3.elements); return this.vertexSize == cyp3.vertexSize && this.elements.equals(cyp3.elements);
} }
@Override @Override
@ -77,8 +77,8 @@ public class VertexFormat {
RenderSystem.recordRenderCall(this::clearBufferState); RenderSystem.recordRenderCall(this::clearBufferState);
return; return;
} }
for (final VertexFormatElement cyn3 : this.getElements()) { for (final VertexFormatElement cyq3 : this.getElements()) {
cyn3.clearBufferState(); cyq3.clearBufferState();
} }
} }
} }

View File

@ -68,8 +68,8 @@ public class VertexFormatElement {
if (object == null || this.getClass() != object.getClass()) { if (object == null || this.getClass() != object.getClass()) {
return false; return false;
} }
final VertexFormatElement cyn3 = (VertexFormatElement)object; final VertexFormatElement cyq3 = (VertexFormatElement)object;
return this.count == cyn3.count && this.index == cyn3.index && this.type == cyn3.type && this.usage == cyn3.usage; return this.count == cyq3.count && this.index == cyq3.index && this.type == cyq3.type && this.usage == cyq3.usage;
} }
@Override @Override

View File

@ -1,20 +1,20 @@
package com.mojang.blaze3d.vertex; package com.mojang.blaze3d.vertex;
public class VertexMultiConsumer { public class VertexMultiConsumer {
public static VertexConsumer create(final VertexConsumer cyl1, final VertexConsumer cyl2) { public static VertexConsumer create(final VertexConsumer cyo1, final VertexConsumer cyo2) {
return new Double(cyl1, cyl2); return new Double(cyo1, cyo2);
} }
static class Double implements VertexConsumer { static class Double implements VertexConsumer {
private final VertexConsumer first; private final VertexConsumer first;
private final VertexConsumer second; private final VertexConsumer second;
public Double(final VertexConsumer cyl1, final VertexConsumer cyl2) { public Double(final VertexConsumer cyo1, final VertexConsumer cyo2) {
if (cyl1 == cyl2) { if (cyo1 == cyo2) {
throw new IllegalArgumentException("Duplicate delegates"); throw new IllegalArgumentException("Duplicate delegates");
} }
this.first = cyl1; this.first = cyo1;
this.second = cyl2; this.second = cyo2;
} }
@Override @Override

View File

@ -86,7 +86,7 @@ public final class Transformation {
if (e1 != null) { if (e1 != null) {
b5.m03 = e1.x(); b5.m03 = e1.x();
b5.m13 = e1.y(); b5.m13 = e1.y();
b5.m32 = e1.z(); b5.m23 = e1.z();
} }
return b5; return b5;
} }

View File

@ -24,8 +24,8 @@ public final class Vector3f {
this.z = float3; this.z = float3;
} }
public Vector3f(final Vec3 cvi) { public Vector3f(final Vec3 cvl) {
this((float)cvi.x, (float)cvi.y, (float)cvi.z); this((float)cvl.x, (float)cvl.y, (float)cvl.z);
} }
@Override @Override

View File

@ -30,7 +30,6 @@ import java.io.IOException;
import com.mojang.realmsclient.exception.RealmsServiceException; import com.mojang.realmsclient.exception.RealmsServiceException;
import com.mojang.realmsclient.gui.screens.RealmsGenericErrorScreen; import com.mojang.realmsclient.gui.screens.RealmsGenericErrorScreen;
import com.mojang.realmsclient.gui.screens.RealmsClientOutdatedScreen; import com.mojang.realmsclient.gui.screens.RealmsClientOutdatedScreen;
import com.mojang.realmsclient.gui.screens.RealmsCreateTrialScreen;
import com.mojang.realmsclient.dto.RegionPingResult; import com.mojang.realmsclient.dto.RegionPingResult;
import com.mojang.realmsclient.dto.PingResult; import com.mojang.realmsclient.dto.PingResult;
import com.mojang.realmsclient.client.Ping; import com.mojang.realmsclient.client.Ping;
@ -364,16 +363,16 @@ public class RealmsMainScreen extends RealmsScreen {
private void pingRegions() { private void pingRegions() {
final List<RegionPingResult> list2; final List<RegionPingResult> list2;
final RealmsClient cyv3; final RealmsClient cyy3;
final PingResult pingResult4; final PingResult pingResult4;
new Thread(() -> { new Thread(() -> {
list2 = Ping.pingAllRegions(); list2 = Ping.pingAllRegions();
cyv3 = RealmsClient.createRealmsClient(); cyy3 = RealmsClient.createRealmsClient();
pingResult4 = new PingResult(); pingResult4 = new PingResult();
pingResult4.pingResults = list2; pingResult4.pingResults = list2;
pingResult4.worldIds = this.getOwnedNonExpiredWorldIds(); pingResult4.worldIds = this.getOwnedNonExpiredWorldIds();
try { try {
cyv3.sendPingResults(pingResult4); cyy3.sendPingResults(pingResult4);
} }
catch (Throwable throwable5) { catch (Throwable throwable5) {
RealmsMainScreen.LOGGER.warn("Could not send ping result to Realms: ", throwable5); RealmsMainScreen.LOGGER.warn("Could not send ping result to Realms: ", throwable5);
@ -397,10 +396,6 @@ public class RealmsMainScreen extends RealmsScreen {
this.stopRealmsFetcher(); this.stopRealmsFetcher();
} }
public void setCreatedTrial(final boolean boolean1) {
this.createdTrial = boolean1;
}
private void onPlay() { private void onPlay() {
final RealmsServer realmsServer2 = this.findServer(this.selectedServerId); final RealmsServer realmsServer2 = this.findServer(this.selectedServerId);
if (realmsServer2 == null) { if (realmsServer2 == null) {
@ -422,7 +417,8 @@ public class RealmsMainScreen extends RealmsScreen {
if (!this.trialsAvailable || this.createdTrial) { if (!this.trialsAvailable || this.createdTrial) {
return; return;
} }
Realms.setScreen(new RealmsCreateTrialScreen(this)); RealmsUtil.browseTo("https://aka.ms/startjavarealmstrial");
Realms.setScreen(this.lastScreen);
} }
private void checkClientCompatability() { private void checkClientCompatability() {
@ -431,9 +427,9 @@ public class RealmsMainScreen extends RealmsScreen {
new Thread("MCO Compatability Checker #1") { new Thread("MCO Compatability Checker #1") {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
try { try {
final RealmsClient.CompatibleVersionResponse a3 = cyv2.clientCompatible(); final RealmsClient.CompatibleVersionResponse a3 = cyy2.clientCompatible();
if (a3.equals(RealmsClient.CompatibleVersionResponse.OUTDATED)) { if (a3.equals(RealmsClient.CompatibleVersionResponse.OUTDATED)) {
RealmsMainScreen.realmsGenericErrorScreen = new RealmsClientOutdatedScreen(RealmsMainScreen.this.lastScreen, true); RealmsMainScreen.realmsGenericErrorScreen = new RealmsClientOutdatedScreen(RealmsMainScreen.this.lastScreen, true);
Realms.setScreen(RealmsMainScreen.realmsGenericErrorScreen); Realms.setScreen(RealmsMainScreen.realmsGenericErrorScreen);
@ -446,15 +442,15 @@ public class RealmsMainScreen extends RealmsScreen {
} }
RealmsMainScreen.this.checkParentalConsent(); RealmsMainScreen.this.checkParentalConsent();
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
RealmsMainScreen.checkedClientCompatability = false; RealmsMainScreen.checkedClientCompatability = false;
RealmsMainScreen.LOGGER.error("Couldn't connect to realms: ", czd3.toString()); RealmsMainScreen.LOGGER.error("Couldn't connect to realms: ", czg3.toString());
if (czd3.httpResultCode == 401) { if (czg3.httpResultCode == 401) {
RealmsMainScreen.realmsGenericErrorScreen = new RealmsGenericErrorScreen(RealmsScreen.getLocalizedString("mco.error.invalid.session.title"), RealmsScreen.getLocalizedString("mco.error.invalid.session.message"), RealmsMainScreen.this.lastScreen); RealmsMainScreen.realmsGenericErrorScreen = new RealmsGenericErrorScreen(RealmsScreen.getLocalizedString("mco.error.invalid.session.title"), RealmsScreen.getLocalizedString("mco.error.invalid.session.message"), RealmsMainScreen.this.lastScreen);
Realms.setScreen(RealmsMainScreen.realmsGenericErrorScreen); Realms.setScreen(RealmsMainScreen.realmsGenericErrorScreen);
return; return;
} }
Realms.setScreen(new RealmsGenericErrorScreen(czd3, RealmsMainScreen.this.lastScreen)); Realms.setScreen(new RealmsGenericErrorScreen(czg3, RealmsMainScreen.this.lastScreen));
} }
catch (IOException iOException3) { catch (IOException iOException3) {
RealmsMainScreen.checkedClientCompatability = false; RealmsMainScreen.checkedClientCompatability = false;
@ -473,9 +469,9 @@ public class RealmsMainScreen extends RealmsScreen {
new Thread("MCO Compatability Checker #1") { new Thread("MCO Compatability Checker #1") {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
try { try {
final Boolean boolean3 = cyv2.mcoEnabled(); final Boolean boolean3 = cyy2.mcoEnabled();
if (boolean3) { if (boolean3) {
RealmsMainScreen.LOGGER.info("Realms is available for this user"); RealmsMainScreen.LOGGER.info("Realms is available for this user");
RealmsMainScreen.hasParentalConsent = true; RealmsMainScreen.hasParentalConsent = true;
@ -487,9 +483,9 @@ public class RealmsMainScreen extends RealmsScreen {
} }
RealmsMainScreen.checkedParentalConsent = true; RealmsMainScreen.checkedParentalConsent = true;
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
RealmsMainScreen.LOGGER.error("Couldn't connect to realms: ", czd3.toString()); RealmsMainScreen.LOGGER.error("Couldn't connect to realms: ", czg3.toString());
Realms.setScreen(new RealmsGenericErrorScreen(czd3, RealmsMainScreen.this.lastScreen)); Realms.setScreen(new RealmsGenericErrorScreen(czg3, RealmsMainScreen.this.lastScreen));
} }
catch (IOException iOException3) { catch (IOException iOException3) {
RealmsMainScreen.LOGGER.error("Couldn't connect to realms: ", iOException3.getMessage()); RealmsMainScreen.LOGGER.error("Couldn't connect to realms: ", iOException3.getMessage());
@ -504,17 +500,17 @@ public class RealmsMainScreen extends RealmsScreen {
new Thread("MCO Stage Availability Checker #1") { new Thread("MCO Stage Availability Checker #1") {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
try { try {
final Boolean boolean3 = cyv2.stageAvailable(); final Boolean boolean3 = cyy2.stageAvailable();
if (boolean3) { if (boolean3) {
RealmsClient.switchToStage(); RealmsClient.switchToStage();
RealmsMainScreen.LOGGER.info("Switched to stage"); RealmsMainScreen.LOGGER.info("Switched to stage");
RealmsMainScreen.realmsDataFetcher.forceUpdate(); RealmsMainScreen.realmsDataFetcher.forceUpdate();
} }
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
RealmsMainScreen.LOGGER.error("Couldn't connect to Realms: " + czd3); RealmsMainScreen.LOGGER.error("Couldn't connect to Realms: " + czg3);
} }
catch (IOException iOException3) { catch (IOException iOException3) {
RealmsMainScreen.LOGGER.error("Couldn't parse response connecting to Realms: " + iOException3.getMessage()); RealmsMainScreen.LOGGER.error("Couldn't parse response connecting to Realms: " + iOException3.getMessage());
@ -529,17 +525,17 @@ public class RealmsMainScreen extends RealmsScreen {
new Thread("MCO Local Availability Checker #1") { new Thread("MCO Local Availability Checker #1") {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
try { try {
final Boolean boolean3 = cyv2.stageAvailable(); final Boolean boolean3 = cyy2.stageAvailable();
if (boolean3) { if (boolean3) {
RealmsClient.switchToLocal(); RealmsClient.switchToLocal();
RealmsMainScreen.LOGGER.info("Switched to local"); RealmsMainScreen.LOGGER.info("Switched to local");
RealmsMainScreen.realmsDataFetcher.forceUpdate(); RealmsMainScreen.realmsDataFetcher.forceUpdate();
} }
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
RealmsMainScreen.LOGGER.error("Couldn't connect to Realms: " + czd3); RealmsMainScreen.LOGGER.error("Couldn't connect to Realms: " + czg3);
} }
catch (IOException iOException3) { catch (IOException iOException3) {
RealmsMainScreen.LOGGER.error("Couldn't parse response connecting to Realms: " + iOException3.getMessage()); RealmsMainScreen.LOGGER.error("Couldn't parse response connecting to Realms: " + iOException3.getMessage());
@ -561,8 +557,8 @@ public class RealmsMainScreen extends RealmsScreen {
private void configureClicked(final RealmsServer realmsServer) { private void configureClicked(final RealmsServer realmsServer) {
if (Realms.getUUID().equals(realmsServer.ownerUUID) || RealmsMainScreen.overrideConfigure) { if (Realms.getUUID().equals(realmsServer.ownerUUID) || RealmsMainScreen.overrideConfigure) {
this.saveListScrollPosition(); this.saveListScrollPosition();
final Minecraft dbl3 = Minecraft.getInstance(); final Minecraft dbn3 = Minecraft.getInstance();
dbl3.execute(() -> dbl3.setScreen(new RealmsConfigureWorldScreen(this, realmsServer.id).getProxy())); dbn3.execute(() -> dbn3.setScreen(new RealmsConfigureWorldScreen(this, realmsServer.id).getProxy()));
} }
} }
@ -598,8 +594,8 @@ public class RealmsMainScreen extends RealmsScreen {
try { try {
final RealmsServer realmsServer2 = RealmsMainScreen.this.findServer(RealmsMainScreen.this.selectedServerId); final RealmsServer realmsServer2 = RealmsMainScreen.this.findServer(RealmsMainScreen.this.selectedServerId);
if (realmsServer2 != null) { if (realmsServer2 != null) {
final RealmsClient cyv3 = RealmsClient.createRealmsClient(); final RealmsClient cyy3 = RealmsClient.createRealmsClient();
cyv3.uninviteMyselfFrom(realmsServer2.id); cyy3.uninviteMyselfFrom(realmsServer2.id);
RealmsMainScreen.realmsDataFetcher.removeItem(realmsServer2); RealmsMainScreen.realmsDataFetcher.removeItem(realmsServer2);
RealmsMainScreen.this.realmsServers.remove(realmsServer2); RealmsMainScreen.this.realmsServers.remove(realmsServer2);
RealmsMainScreen.this.realmSelectionList.children().removeIf(realmListEntry -> realmListEntry instanceof RealmSelectionListEntry && realmListEntry.mServerData.id == RealmsMainScreen.this.selectedServerId); RealmsMainScreen.this.realmSelectionList.children().removeIf(realmListEntry -> realmListEntry instanceof RealmSelectionListEntry && realmListEntry.mServerData.id == RealmsMainScreen.this.selectedServerId);
@ -609,9 +605,9 @@ public class RealmsMainScreen extends RealmsScreen {
RealmsMainScreen.this.playButton.active(false); RealmsMainScreen.this.playButton.active(false);
} }
} }
catch (RealmsServiceException czd2) { catch (RealmsServiceException czg2) {
RealmsMainScreen.LOGGER.error("Couldn't configure world"); RealmsMainScreen.LOGGER.error("Couldn't configure world");
Realms.setScreen(new RealmsGenericErrorScreen(czd2, RealmsMainScreen.this)); Realms.setScreen(new RealmsGenericErrorScreen(czg2, RealmsMainScreen.this));
} }
} }
}.start(); }.start();
@ -649,7 +645,7 @@ public class RealmsMainScreen extends RealmsScreen {
@Override @Override
public boolean charTyped(final char character, final int integer) { public boolean charTyped(final char character, final int integer) {
this.keyCombos.forEach(cyq -> cyq.keyPressed(character)); this.keyCombos.forEach(cyt -> cyt.keyPressed(character));
return true; return true;
} }
@ -859,9 +855,9 @@ public class RealmsMainScreen extends RealmsScreen {
} }
private void connectToServer(final RealmsServer realmsServer, final RealmsScreen realmsScreen) { private void connectToServer(final RealmsServer realmsServer, final RealmsScreen realmsScreen) {
final RealmsLongRunningMcoTaskScreen czx4 = new RealmsLongRunningMcoTaskScreen(realmsScreen, new RealmsTasks.RealmsGetServerDetailsTask(this, realmsScreen, realmsServer, this.connectLock)); final RealmsLongRunningMcoTaskScreen czz4 = new RealmsLongRunningMcoTaskScreen(realmsScreen, new RealmsTasks.RealmsGetServerDetailsTask(this, realmsScreen, realmsServer, this.connectLock));
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
private boolean isSelfOwnedServer(final RealmsServer realmsServer) { private boolean isSelfOwnedServer(final RealmsServer realmsServer) {
@ -1053,12 +1049,6 @@ public class RealmsMainScreen extends RealmsScreen {
return new RealmsMainScreen(this.lastScreen); return new RealmsMainScreen(this.lastScreen);
} }
public void closePopup() {
if (this.shouldShowPopup() && this.popupOpenedByUser) {
this.popupOpenedByUser = false;
}
}
public static void updateTeaserImages(final ResourceManager zb) { public static void updateTeaserImages(final ResourceManager zb) {
final Collection<ResourceLocation> collection2 = zb.listResources("textures/gui/images", string -> string.endsWith(".png")); final Collection<ResourceLocation> collection2 = zb.listResources("textures/gui/images", string -> string.endsWith(".png"));
RealmsMainScreen.teaserImages = collection2.stream().filter(sm -> sm.getNamespace().equals("realms")).collect(ImmutableList.toImmutableList()); RealmsMainScreen.teaserImages = collection2.stream().filter(sm -> sm.getNamespace().equals("realms")).collect(ImmutableList.toImmutableList());
@ -1377,8 +1367,8 @@ public class RealmsMainScreen extends RealmsScreen {
@Override @Override
public void onPress() { public void onPress() {
final RealmsPendingInvitesScreen daa2 = new RealmsPendingInvitesScreen(RealmsMainScreen.this.lastScreen); final RealmsPendingInvitesScreen dac2 = new RealmsPendingInvitesScreen(RealmsMainScreen.this.lastScreen);
Realms.setScreen(daa2); Realms.setScreen(dac2);
} }
@Override @Override

View File

@ -45,7 +45,7 @@ public class FileUpload {
private CompletableFuture<UploadResult> uploadTask; private CompletableFuture<UploadResult> uploadTask;
private final RequestConfig requestConfig; private final RequestConfig requestConfig;
public FileUpload(final File file, final long long2, final int integer, final UploadInfo uploadInfo, final String string5, final String string6, final String string7, final UploadStatus cyz) { public FileUpload(final File file, final long long2, final int integer, final UploadInfo uploadInfo, final String string5, final String string6, final String string7, final UploadStatus czc) {
this.cancelled = new AtomicBoolean(false); this.cancelled = new AtomicBoolean(false);
this.requestConfig = RequestConfig.custom().setSocketTimeout((int)TimeUnit.MINUTES.toMillis(10L)).setConnectTimeout((int)TimeUnit.SECONDS.toMillis(15L)).build(); this.requestConfig = RequestConfig.custom().setSocketTimeout((int)TimeUnit.MINUTES.toMillis(10L)).setConnectTimeout((int)TimeUnit.SECONDS.toMillis(15L)).build();
this.file = file; this.file = file;
@ -55,7 +55,7 @@ public class FileUpload {
this.sessionId = string5; this.sessionId = string5;
this.username = string6; this.username = string6;
this.clientVersion = string7; this.clientVersion = string7;
this.uploadStatus = cyz; this.uploadStatus = czc;
} }
public void upload(final Consumer<UploadResult> consumer) { public void upload(final Consumer<UploadResult> consumer) {
@ -166,11 +166,11 @@ public class FileUpload {
private final InputStream content; private final InputStream content;
private final UploadStatus uploadStatus; private final UploadStatus uploadStatus;
public CustomInputStreamEntity(final InputStream inputStream, final long long2, final UploadStatus cyz) { public CustomInputStreamEntity(final InputStream inputStream, final long long2, final UploadStatus czc) {
super(inputStream); super(inputStream);
this.content = inputStream; this.content = inputStream;
this.length = long2; this.length = long2;
this.uploadStatus = cyz; this.uploadStatus = czc;
} }
public void writeTo(final OutputStream outputStream) throws IOException { public void writeTo(final OutputStream outputStream) throws IOException {

View File

@ -303,14 +303,6 @@ public class RealmsClient {
return Boolean.valueOf(string3); return Boolean.valueOf(string3);
} }
public RealmsServer createTrial(final String string1, final String string2) throws RealmsServiceException, IOException {
final RealmsDescriptionDto realmsDescriptionDto4 = new RealmsDescriptionDto(string1, string2);
final String string3 = RealmsClient.gson.toJson(realmsDescriptionDto4);
final String string4 = this.url("trial");
final String string5 = this.execute(Request.post(string4, string3, 5000, 10000));
return RealmsServer.parse(string5);
}
public void deleteWorld(final long long1) throws RealmsServiceException, IOException { public void deleteWorld(final long long1) throws RealmsServiceException, IOException {
final String string4 = this.url("worlds" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(long1))); final String string4 = this.url("worlds" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(long1)));
this.execute(Request.delete(string4)); this.execute(Request.delete(string4));
@ -331,22 +323,22 @@ public class RealmsClient {
} }
} }
private String execute(final Request<?> cyy) throws RealmsServiceException { private String execute(final Request<?> czb) throws RealmsServiceException {
cyy.cookie("sid", this.sessionId); czb.cookie("sid", this.sessionId);
cyy.cookie("user", this.username); czb.cookie("user", this.username);
cyy.cookie("version", Realms.getMinecraftVersionString()); czb.cookie("version", Realms.getMinecraftVersionString());
try { try {
final int integer3 = cyy.responseCode(); final int integer3 = czb.responseCode();
if (integer3 == 503) { if (integer3 == 503) {
final int integer4 = cyy.getRetryAfterHeader(); final int integer4 = czb.getRetryAfterHeader();
throw new RetryCallException(integer4); throw new RetryCallException(integer4);
} }
final String string4 = cyy.text(); final String string4 = czb.text();
if (integer3 >= 200 && integer3 < 300) { if (integer3 >= 200 && integer3 < 300) {
return string4; return string4;
} }
if (integer3 == 401) { if (integer3 == 401) {
final String string5 = cyy.getHeader("WWW-Authenticate"); final String string5 = czb.getHeader("WWW-Authenticate");
RealmsClient.LOGGER.info("Could not authorize you against Realms server: " + string5); RealmsClient.LOGGER.info("Could not authorize you against Realms server: " + string5);
throw new RealmsServiceException(integer3, string5, -1, string5); throw new RealmsServiceException(integer3, string5, -1, string5);
} }
@ -354,12 +346,12 @@ public class RealmsClient {
RealmsClient.LOGGER.error("Realms error code: " + integer3 + " message: " + string4); RealmsClient.LOGGER.error("Realms error code: " + integer3 + " message: " + string4);
throw new RealmsServiceException(integer3, string4, integer3, ""); throw new RealmsServiceException(integer3, string4, integer3, "");
} }
final RealmsError cyx5 = new RealmsError(string4); final RealmsError cza5 = new RealmsError(string4);
RealmsClient.LOGGER.error("Realms http code: " + integer3 + " - error code: " + cyx5.getErrorCode() + " - message: " + cyx5.getErrorMessage() + " - raw body: " + string4); RealmsClient.LOGGER.error("Realms http code: " + integer3 + " - error code: " + cza5.getErrorCode() + " - message: " + cza5.getErrorMessage() + " - raw body: " + string4);
throw new RealmsServiceException(integer3, string4, cyx5); throw new RealmsServiceException(integer3, string4, cza5);
} }
catch (RealmsHttpException czc3) { catch (RealmsHttpException czf3) {
throw new RealmsServiceException(500, "Could not connect to Realms: " + czc3.getMessage(), -1, ""); throw new RealmsServiceException(500, "Could not connect to Realms: " + czf3.getMessage(), -1, "");
} }
} }

View File

@ -136,9 +136,9 @@ public abstract class Request<T extends Request<T>> {
if (this.connected) { if (this.connected) {
return (T)this; return (T)this;
} }
final T cyy2 = this.doConnect(); final T czb2 = this.doConnect();
this.connected = true; this.connected = true;
return cyy2; return czb2;
} }
protected abstract T doConnect(); protected abstract T doConnect();

View File

@ -9,12 +9,12 @@ public class RealmsServiceException extends Exception {
public final int errorCode; public final int errorCode;
public final String errorMsg; public final String errorMsg;
public RealmsServiceException(final int integer, final String string, final RealmsError cyx) { public RealmsServiceException(final int integer, final String string, final RealmsError cza) {
super(string); super(string);
this.httpResultCode = integer; this.httpResultCode = integer;
this.httpResponseContent = string; this.httpResponseContent = string;
this.errorCode = cyx.getErrorCode(); this.errorCode = cza.getErrorCode();
this.errorMsg = cyx.getErrorMessage(); this.errorMsg = cza.getErrorMessage();
} }
public RealmsServiceException(final int integer1, final String string2, final int integer3, final String string4) { public RealmsServiceException(final int integer1, final String string2, final int integer3, final String string4) {

View File

@ -62,8 +62,8 @@ public enum ChatFormatting {
} }
static { static {
FORMATTING_BY_CHAR = Arrays.<ChatFormatting>stream(values()).collect(Collectors.toMap(ChatFormatting::getChar, czf -> czf)); FORMATTING_BY_CHAR = Arrays.<ChatFormatting>stream(values()).collect(Collectors.toMap(ChatFormatting::getChar, czi -> czi));
FORMATTING_BY_NAME = Arrays.<ChatFormatting>stream(values()).collect(Collectors.toMap(ChatFormatting::getName, czf -> czf)); FORMATTING_BY_NAME = Arrays.<ChatFormatting>stream(values()).collect(Collectors.toMap(ChatFormatting::getName, czi -> czi));
STRIP_FORMATTING_PATTERN = Pattern.compile("(?i)§[0-9A-FK-OR]"); STRIP_FORMATTING_PATTERN = Pattern.compile("(?i)§[0-9A-FK-OR]");
} }
} }

View File

@ -5,8 +5,8 @@ import com.mojang.realmsclient.gui.screens.RealmsLongRunningMcoTaskScreen;
public abstract class LongRunningTask implements Runnable { public abstract class LongRunningTask implements Runnable {
protected RealmsLongRunningMcoTaskScreen longRunningMcoTaskScreen; protected RealmsLongRunningMcoTaskScreen longRunningMcoTaskScreen;
public void setScreen(final RealmsLongRunningMcoTaskScreen czx) { public void setScreen(final RealmsLongRunningMcoTaskScreen czz) {
this.longRunningMcoTaskScreen = czx; this.longRunningMcoTaskScreen = czz;
} }
public void error(final String string) { public void error(final String string) {

View File

@ -223,9 +223,9 @@ public class RealmsDataFetcher {
private void updateServersList() { private void updateServersList() {
try { try {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
if (cyv2 != null) { if (cyy2 != null) {
final List<RealmsServer> list3 = cyv2.listWorlds().servers; final List<RealmsServer> list3 = cyy2.listWorlds().servers;
if (list3 != null) { if (list3 != null) {
RealmsDataFetcher.this.sort(list3); RealmsDataFetcher.this.sort(list3);
RealmsDataFetcher.this.setServers(list3); RealmsDataFetcher.this.setServers(list3);
@ -256,9 +256,9 @@ public class RealmsDataFetcher {
private void updatePendingInvites() { private void updatePendingInvites() {
try { try {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
if (cyv2 != null) { if (cyy2 != null) {
RealmsDataFetcher.this.pendingInvitesCount = cyv2.pendingInvitesCount(); RealmsDataFetcher.this.pendingInvitesCount = cyy2.pendingInvitesCount();
RealmsDataFetcher.this.fetchStatus.put(Task.PENDING_INVITE, true); RealmsDataFetcher.this.fetchStatus.put(Task.PENDING_INVITE, true);
} }
} }
@ -281,9 +281,9 @@ public class RealmsDataFetcher {
private void getTrialAvailable() { private void getTrialAvailable() {
try { try {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
if (cyv2 != null) { if (cyy2 != null) {
RealmsDataFetcher.this.trialAvailable = cyv2.trialAvailable(); RealmsDataFetcher.this.trialAvailable = cyy2.trialAvailable();
RealmsDataFetcher.this.fetchStatus.put(Task.TRIAL_AVAILABLE, true); RealmsDataFetcher.this.fetchStatus.put(Task.TRIAL_AVAILABLE, true);
} }
} }
@ -306,9 +306,9 @@ public class RealmsDataFetcher {
private void getLiveStats() { private void getLiveStats() {
try { try {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
if (cyv2 != null) { if (cyy2 != null) {
RealmsDataFetcher.this.livestats = cyv2.getLiveStats(); RealmsDataFetcher.this.livestats = cyy2.getLiveStats();
RealmsDataFetcher.this.fetchStatus.put(Task.LIVE_STATS, true); RealmsDataFetcher.this.fetchStatus.put(Task.LIVE_STATS, true);
} }
} }
@ -331,11 +331,11 @@ public class RealmsDataFetcher {
private void getUnreadNews() { private void getUnreadNews() {
try { try {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
if (cyv2 != null) { if (cyy2 != null) {
RealmsNews realmsNews3 = null; RealmsNews realmsNews3 = null;
try { try {
realmsNews3 = cyv2.getNews(); realmsNews3 = cyy2.getNews();
} }
catch (Exception ex) {} catch (Exception ex) {}
final RealmsPersistence.RealmsPersistenceData a4 = RealmsPersistence.readFile(); final RealmsPersistence.RealmsPersistenceData a4 = RealmsPersistence.readFile();

View File

@ -41,9 +41,9 @@ public abstract class RowButton {
public abstract void onClick(final int integer); public abstract void onClick(final int integer);
public static void drawButtonsInRow(final List<RowButton> list, final RealmsObjectSelectionList realmsObjectSelectionList, final int integer3, final int integer4, final int integer5, final int integer6) { public static void drawButtonsInRow(final List<RowButton> list, final RealmsObjectSelectionList realmsObjectSelectionList, final int integer3, final int integer4, final int integer5, final int integer6) {
for (final RowButton czk8 : list) { for (final RowButton czn8 : list) {
if (realmsObjectSelectionList.getRowWidth() > czk8.getRight()) { if (realmsObjectSelectionList.getRowWidth() > czn8.getRight()) {
czk8.drawForRowAt(integer3, integer4, integer5, integer6); czn8.drawForRowAt(integer3, integer4, integer5, integer6);
} }
} }
} }
@ -57,9 +57,9 @@ public abstract class RowButton {
final int integer4 = realmsObjectSelectionList.getRowTop(integer2); final int integer4 = realmsObjectSelectionList.getRowTop(integer2);
final int integer5 = (int)(double5 - integer3); final int integer5 = (int)(double5 - integer3);
final int integer6 = (int)(double6 - integer4); final int integer6 = (int)(double6 - integer4);
for (final RowButton czk15 : list) { for (final RowButton czn15 : list) {
if (integer5 >= czk15.xOffset && integer5 <= czk15.getRight() && integer6 >= czk15.yOffset && integer6 <= czk15.getBottom()) { if (integer5 >= czn15.xOffset && integer5 <= czn15.getRight() && integer6 >= czn15.yOffset && integer6 <= czn15.getBottom()) {
czk15.onClick(integer2); czn15.onClick(integer2);
} }
} }
} }

View File

@ -43,11 +43,11 @@ public class RealmsBackupScreen extends RealmsScreen {
private final RealmsServer serverData; private final RealmsServer serverData;
private RealmsLabel titleLabel; private RealmsLabel titleLabel;
public RealmsBackupScreen(final RealmsConfigureWorldScreen czp, final RealmsServer realmsServer, final int integer) { public RealmsBackupScreen(final RealmsConfigureWorldScreen czs, final RealmsServer realmsServer, final int integer) {
this.backups = Collections.<Backup>emptyList(); this.backups = Collections.<Backup>emptyList();
this.selectedBackup = -1; this.selectedBackup = -1;
this.noBackups = false; this.noBackups = false;
this.lastScreen = czp; this.lastScreen = czs;
this.serverData = realmsServer; this.serverData = realmsServer;
this.slotId = integer; this.slotId = integer;
} }
@ -62,9 +62,9 @@ public class RealmsBackupScreen extends RealmsScreen {
new Thread("Realms-fetch-backups") { new Thread("Realms-fetch-backups") {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
try { try {
final List<Backup> list3 = cyv2.backupsFor(RealmsBackupScreen.this.serverData.id).backups; final List<Backup> list3 = cyy2.backupsFor(RealmsBackupScreen.this.serverData.id).backups;
final Iterator<Backup> iterator; final Iterator<Backup> iterator;
Backup backup4; Backup backup4;
Realms.execute(() -> { Realms.execute(() -> {
@ -79,8 +79,8 @@ public class RealmsBackupScreen extends RealmsScreen {
RealmsBackupScreen.this.generateChangeList(); RealmsBackupScreen.this.generateChangeList();
}); });
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
RealmsBackupScreen.LOGGER.error("Couldn't request backups", (Throwable)czd3); RealmsBackupScreen.LOGGER.error("Couldn't request backups", (Throwable)czg3);
} }
} }
}.start(); }.start();
@ -203,9 +203,9 @@ public class RealmsBackupScreen extends RealmsScreen {
private void downloadWorldData() { private void downloadWorldData() {
final RealmsTasks.DownloadTask b2 = new RealmsTasks.DownloadTask(this.serverData.id, this.slotId, this.serverData.name + " (" + this.serverData.slots.get(this.serverData.activeSlot).getSlotName(this.serverData.activeSlot) + ")", this); final RealmsTasks.DownloadTask b2 = new RealmsTasks.DownloadTask(this.serverData.id, this.slotId, this.serverData.name + " (" + this.serverData.slots.get(this.serverData.activeSlot).getSlotName(this.serverData.activeSlot) + ")", this);
final RealmsLongRunningMcoTaskScreen czx3 = new RealmsLongRunningMcoTaskScreen(this.lastScreen.getNewScreen(), b2); final RealmsLongRunningMcoTaskScreen czz3 = new RealmsLongRunningMcoTaskScreen(this.lastScreen.getNewScreen(), b2);
czx3.start(); czz3.start();
Realms.setScreen(czx3); Realms.setScreen(czz3);
} }
@Override @Override
@ -229,9 +229,9 @@ public class RealmsBackupScreen extends RealmsScreen {
final Backup backup2 = this.backups.get(this.selectedBackup); final Backup backup2 = this.backups.get(this.selectedBackup);
this.selectedBackup = -1; this.selectedBackup = -1;
final RealmsTasks.RestoreTask g3 = new RealmsTasks.RestoreTask(backup2, this.serverData.id, this.lastScreen); final RealmsTasks.RestoreTask g3 = new RealmsTasks.RestoreTask(backup2, this.serverData.id, this.lastScreen);
final RealmsLongRunningMcoTaskScreen czx4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen.getNewScreen(), g3); final RealmsLongRunningMcoTaskScreen czz4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen.getNewScreen(), g3);
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
@Override @Override

View File

@ -45,12 +45,12 @@ public class RealmsBrokenWorldScreen extends RealmsScreen {
private final List<Integer> slotsThatHasBeenDownloaded; private final List<Integer> slotsThatHasBeenDownloaded;
private int animTick; private int animTick;
public RealmsBrokenWorldScreen(final RealmsScreen realmsScreen, final RealmsMainScreen cyr, final long long3) { public RealmsBrokenWorldScreen(final RealmsScreen realmsScreen, final RealmsMainScreen cyu, final long long3) {
this.title = RealmsScreen.getLocalizedString("mco.brokenworld.title"); this.title = RealmsScreen.getLocalizedString("mco.brokenworld.title");
this.message = RealmsScreen.getLocalizedString("mco.brokenworld.message.line1") + "\\n" + RealmsScreen.getLocalizedString("mco.brokenworld.message.line2"); this.message = RealmsScreen.getLocalizedString("mco.brokenworld.message.line1") + "\\n" + RealmsScreen.getLocalizedString("mco.brokenworld.message.line2");
this.slotsThatHasBeenDownloaded = Lists.newArrayList(); this.slotsThatHasBeenDownloaded = Lists.newArrayList();
this.lastScreen = realmsScreen; this.lastScreen = realmsScreen;
this.mainScreen = cyr; this.mainScreen = cyu;
this.serverId = long3; this.serverId = long3;
} }
@ -97,12 +97,12 @@ public class RealmsBrokenWorldScreen extends RealmsScreen {
@Override @Override
public void onPress() { public void onPress() {
final int integer2 = RealmsBrokenWorldScreen.resetButtonIds.indexOf(this.id()) + 1; final int integer2 = RealmsBrokenWorldScreen.resetButtonIds.indexOf(this.id()) + 1;
final RealmsResetWorldScreen dad3 = new RealmsResetWorldScreen(RealmsBrokenWorldScreen.this, RealmsBrokenWorldScreen.this.serverData, RealmsBrokenWorldScreen.this); final RealmsResetWorldScreen daf3 = new RealmsResetWorldScreen(RealmsBrokenWorldScreen.this, RealmsBrokenWorldScreen.this.serverData, RealmsBrokenWorldScreen.this);
if (integer2 != RealmsBrokenWorldScreen.this.serverData.activeSlot || RealmsBrokenWorldScreen.this.serverData.worldType.equals(RealmsServer.WorldType.MINIGAME)) { if (integer2 != RealmsBrokenWorldScreen.this.serverData.activeSlot || RealmsBrokenWorldScreen.this.serverData.worldType.equals(RealmsServer.WorldType.MINIGAME)) {
dad3.setSlot(integer2); daf3.setSlot(integer2);
} }
dad3.setConfirmationId(14); daf3.setConfirmationId(14);
Realms.setScreen(dad3); Realms.setScreen(daf3);
} }
}); });
} }
@ -158,16 +158,16 @@ public class RealmsBrokenWorldScreen extends RealmsScreen {
} }
private void fetchServerData(final long long1) { private void fetchServerData(final long long1) {
final RealmsClient cyv4; final RealmsClient cyy4;
new Thread(() -> { new Thread(() -> {
cyv4 = RealmsClient.createRealmsClient(); cyy4 = RealmsClient.createRealmsClient();
try { try {
this.serverData = cyv4.getOwnWorld(long1); this.serverData = cyy4.getOwnWorld(long1);
this.addButtons(); this.addButtons();
} }
catch (RealmsServiceException czd5) { catch (RealmsServiceException czg5) {
RealmsBrokenWorldScreen.LOGGER.error("Couldn't get own world"); RealmsBrokenWorldScreen.LOGGER.error("Couldn't get own world");
Realms.setScreen(new RealmsGenericErrorScreen(czd5.getMessage(), this.lastScreen)); Realms.setScreen(new RealmsGenericErrorScreen(czg5.getMessage(), this.lastScreen));
} }
catch (IOException iOException5) { catch (IOException iOException5) {
RealmsBrokenWorldScreen.LOGGER.error("Couldn't parse response getting own world"); RealmsBrokenWorldScreen.LOGGER.error("Couldn't parse response getting own world");
@ -182,22 +182,22 @@ public class RealmsBrokenWorldScreen extends RealmsScreen {
return; return;
} }
if (integer == 13 || integer == 14) { if (integer == 13 || integer == 14) {
final RealmsClient cyv2; final RealmsClient cyy2;
RealmsTasks.OpenServerTask c3; RealmsTasks.OpenServerTask c3;
RealmsLongRunningMcoTaskScreen czx4; RealmsLongRunningMcoTaskScreen czz4;
new Thread(() -> { new Thread(() -> {
cyv2 = RealmsClient.createRealmsClient(); cyy2 = RealmsClient.createRealmsClient();
if (this.serverData.state.equals(RealmsServer.State.CLOSED)) { if (this.serverData.state.equals(RealmsServer.State.CLOSED)) {
c3 = new RealmsTasks.OpenServerTask(this.serverData, this, this.lastScreen, true); c3 = new RealmsTasks.OpenServerTask(this.serverData, this, this.lastScreen, true);
czx4 = new RealmsLongRunningMcoTaskScreen(this, c3); czz4 = new RealmsLongRunningMcoTaskScreen(this, c3);
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
else { else {
try { try {
this.mainScreen.newScreen().play(cyv2.getOwnWorld(this.serverId), this); this.mainScreen.newScreen().play(cyy2.getOwnWorld(this.serverId), this);
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
RealmsBrokenWorldScreen.LOGGER.error("Couldn't get own world"); RealmsBrokenWorldScreen.LOGGER.error("Couldn't get own world");
Realms.setScreen(this.lastScreen); Realms.setScreen(this.lastScreen);
} }
@ -219,16 +219,16 @@ public class RealmsBrokenWorldScreen extends RealmsScreen {
} }
private void downloadWorld(final int integer) { private void downloadWorld(final int integer) {
final RealmsClient cyv3 = RealmsClient.createRealmsClient(); final RealmsClient cyy3 = RealmsClient.createRealmsClient();
try { try {
final WorldDownload worldDownload4 = cyv3.download(this.serverData.id, integer); final WorldDownload worldDownload4 = cyy3.download(this.serverData.id, integer);
final RealmsDownloadLatestWorldScreen czt5 = new RealmsDownloadLatestWorldScreen(this, worldDownload4, this.serverData.name + " (" + this.serverData.slots.get(integer).getSlotName(integer) + ")"); final RealmsDownloadLatestWorldScreen czv5 = new RealmsDownloadLatestWorldScreen(this, worldDownload4, this.serverData.name + " (" + this.serverData.slots.get(integer).getSlotName(integer) + ")");
czt5.setConfirmationId(RealmsBrokenWorldScreen.downloadConfirmationIds.get(integer - 1)); czv5.setConfirmationId(RealmsBrokenWorldScreen.downloadConfirmationIds.get(integer - 1));
Realms.setScreen(czt5); Realms.setScreen(czv5);
} }
catch (RealmsServiceException czd4) { catch (RealmsServiceException czg4) {
RealmsBrokenWorldScreen.LOGGER.error("Couldn't download world data"); RealmsBrokenWorldScreen.LOGGER.error("Couldn't download world data");
Realms.setScreen(new RealmsGenericErrorScreen(czd4, this)); Realms.setScreen(new RealmsGenericErrorScreen(czg4, this));
} }
} }
@ -276,9 +276,9 @@ public class RealmsBrokenWorldScreen extends RealmsScreen {
private void switchSlot(final int integer) { private void switchSlot(final int integer) {
final RealmsTasks.SwitchSlotTask i3 = new RealmsTasks.SwitchSlotTask(this.serverData.id, integer, this, 13); final RealmsTasks.SwitchSlotTask i3 = new RealmsTasks.SwitchSlotTask(this.serverData.id, integer, this, 13);
final RealmsLongRunningMcoTaskScreen czx4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, i3); final RealmsLongRunningMcoTaskScreen czz4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, i3);
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
static { static {
@ -298,11 +298,11 @@ public class RealmsBrokenWorldScreen extends RealmsScreen {
public void onPress() { public void onPress() {
final int integer2 = RealmsBrokenWorldScreen.playButtonIds.indexOf(this.id()) + 1; final int integer2 = RealmsBrokenWorldScreen.playButtonIds.indexOf(this.id()) + 1;
if (RealmsBrokenWorldScreen.this.serverData.slots.get(integer2).empty) { if (RealmsBrokenWorldScreen.this.serverData.slots.get(integer2).empty) {
final RealmsResetWorldScreen dad3 = new RealmsResetWorldScreen(RealmsBrokenWorldScreen.this, RealmsBrokenWorldScreen.this.serverData, RealmsBrokenWorldScreen.this, RealmsScreen.getLocalizedString("mco.configure.world.switch.slot"), RealmsScreen.getLocalizedString("mco.configure.world.switch.slot.subtitle"), 10526880, RealmsScreen.getLocalizedString("gui.cancel")); final RealmsResetWorldScreen daf3 = new RealmsResetWorldScreen(RealmsBrokenWorldScreen.this, RealmsBrokenWorldScreen.this.serverData, RealmsBrokenWorldScreen.this, RealmsScreen.getLocalizedString("mco.configure.world.switch.slot"), RealmsScreen.getLocalizedString("mco.configure.world.switch.slot.subtitle"), 10526880, RealmsScreen.getLocalizedString("gui.cancel"));
dad3.setSlot(integer2); daf3.setSlot(integer2);
dad3.setResetTitle(RealmsScreen.getLocalizedString("mco.create.world.reset.title")); daf3.setResetTitle(RealmsScreen.getLocalizedString("mco.create.world.reset.title"));
dad3.setConfirmationId(14); daf3.setConfirmationId(14);
Realms.setScreen(dad3); Realms.setScreen(daf3);
} }
else { else {
RealmsBrokenWorldScreen.this.switchSlot(integer2); RealmsBrokenWorldScreen.this.switchSlot(integer2);

View File

@ -43,8 +43,8 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
private int animTick; private int animTick;
private int clicks; private int clicks;
public RealmsConfigureWorldScreen(final RealmsMainScreen cyr, final long long2) { public RealmsConfigureWorldScreen(final RealmsMainScreen cyu, final long long2) {
this.lastScreen = cyr; this.lastScreen = cyu;
this.serverId = long2; this.serverId = long2;
} }
@ -80,9 +80,9 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
this.buttonsAdd(this.switchMinigameButton = new RealmsButton(8, this.leftButton(0), RealmsConstants.row(13) - 5, 100, 20, RealmsScreen.getLocalizedString("mco.configure.world.buttons.switchminigame")) { this.buttonsAdd(this.switchMinigameButton = new RealmsButton(8, this.leftButton(0), RealmsConstants.row(13) - 5, 100, 20, RealmsScreen.getLocalizedString("mco.configure.world.buttons.switchminigame")) {
@Override @Override
public void onPress() { public void onPress() {
final RealmsSelectWorldTemplateScreen dah2 = new RealmsSelectWorldTemplateScreen(RealmsConfigureWorldScreen.this, RealmsServer.WorldType.MINIGAME); final RealmsSelectWorldTemplateScreen daj2 = new RealmsSelectWorldTemplateScreen(RealmsConfigureWorldScreen.this, RealmsServer.WorldType.MINIGAME);
dah2.setTitle(RealmsScreen.getLocalizedString("mco.template.title.minigame")); daj2.setTitle(RealmsScreen.getLocalizedString("mco.template.title.minigame"));
Realms.setScreen(dah2); Realms.setScreen(daj2);
} }
}); });
this.buttonsAdd(this.optionsButton = new RealmsButton(5, this.leftButton(0), RealmsConstants.row(13) - 5, 90, 20, RealmsScreen.getLocalizedString("mco.configure.world.buttons.options")) { this.buttonsAdd(this.optionsButton = new RealmsButton(5, this.leftButton(0), RealmsConstants.row(13) - 5, 90, 20, RealmsScreen.getLocalizedString("mco.configure.world.buttons.options")) {
@ -132,8 +132,8 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
final int integer2 = this.frame(integer); final int integer2 = this.frame(integer);
final int integer3 = RealmsConstants.row(5) + 5; final int integer3 = RealmsConstants.row(5) + 5;
final int integer4 = 100 + integer; final int integer4 = 100 + integer;
final RealmsWorldSlotButton czj6 = new RealmsWorldSlotButton(integer2, integer3, 80, 80, () -> this.serverData, string -> this.toolTip = string, integer4, integer, this); final RealmsWorldSlotButton czm6 = new RealmsWorldSlotButton(integer2, integer3, 80, 80, () -> this.serverData, string -> this.toolTip = string, integer4, integer, this);
this.getProxy().buttonsAdd(czj6); this.getProxy().buttonsAdd(czm6);
} }
private int leftButton(final int integer) { private int leftButton(final int integer) {
@ -206,11 +206,11 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
} }
private void fetchServerData(final long long1) { private void fetchServerData(final long long1) {
final RealmsClient cyv4; final RealmsClient cyy4;
new Thread(() -> { new Thread(() -> {
cyv4 = RealmsClient.createRealmsClient(); cyy4 = RealmsClient.createRealmsClient();
try { try {
this.serverData = cyv4.getOwnWorld(long1); this.serverData = cyy4.getOwnWorld(long1);
this.disableButtons(); this.disableButtons();
if (this.isMinigame()) { if (this.isMinigame()) {
this.showMinigameButtons(); this.showMinigameButtons();
@ -219,9 +219,9 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
this.showRegularButtons(); this.showRegularButtons();
} }
} }
catch (RealmsServiceException czd5) { catch (RealmsServiceException czg5) {
RealmsConfigureWorldScreen.LOGGER.error("Couldn't get own world"); RealmsConfigureWorldScreen.LOGGER.error("Couldn't get own world");
Realms.setScreen(new RealmsGenericErrorScreen(czd5.getMessage(), this.lastScreen)); Realms.setScreen(new RealmsGenericErrorScreen(czg5.getMessage(), this.lastScreen));
} }
catch (IOException iOException5) { catch (IOException iOException5) {
RealmsConfigureWorldScreen.LOGGER.error("Couldn't parse response getting own world"); RealmsConfigureWorldScreen.LOGGER.error("Couldn't parse response getting own world");
@ -281,10 +281,10 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
} }
private void switchToMinigame() { private void switchToMinigame() {
final RealmsSelectWorldTemplateScreen dah2 = new RealmsSelectWorldTemplateScreen(this, RealmsServer.WorldType.MINIGAME); final RealmsSelectWorldTemplateScreen daj2 = new RealmsSelectWorldTemplateScreen(this, RealmsServer.WorldType.MINIGAME);
dah2.setTitle(RealmsScreen.getLocalizedString("mco.template.title.minigame")); daj2.setTitle(RealmsScreen.getLocalizedString("mco.template.title.minigame"));
dah2.setWarning(RealmsScreen.getLocalizedString("mco.minigame.world.info.line1") + "\\n" + RealmsScreen.getLocalizedString("mco.minigame.world.info.line2")); daj2.setWarning(RealmsScreen.getLocalizedString("mco.minigame.world.info.line1") + "\\n" + RealmsScreen.getLocalizedString("mco.minigame.world.info.line2"));
Realms.setScreen(dah2); Realms.setScreen(daj2);
} }
private void switchToFullSlot(final int integer, final RealmsServer realmsServer) { private void switchToFullSlot(final int integer, final RealmsServer realmsServer) {
@ -303,13 +303,13 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
private void switchToEmptySlot(final int integer, final RealmsServer realmsServer) { private void switchToEmptySlot(final int integer, final RealmsServer realmsServer) {
final String string4 = RealmsScreen.getLocalizedString("mco.configure.world.slot.switch.question.line1"); final String string4 = RealmsScreen.getLocalizedString("mco.configure.world.slot.switch.question.line1");
final String string5 = RealmsScreen.getLocalizedString("mco.configure.world.slot.switch.question.line2"); final String string5 = RealmsScreen.getLocalizedString("mco.configure.world.slot.switch.question.line2");
RealmsResetWorldScreen dad6; RealmsResetWorldScreen daf6;
Realms.setScreen(new RealmsLongConfirmationScreen((boolean3, integer4) -> { Realms.setScreen(new RealmsLongConfirmationScreen((boolean3, integer4) -> {
if (boolean3) { if (boolean3) {
dad6 = new RealmsResetWorldScreen(this, realmsServer, this.getNewScreen(), RealmsScreen.getLocalizedString("mco.configure.world.switch.slot"), RealmsScreen.getLocalizedString("mco.configure.world.switch.slot.subtitle"), 10526880, RealmsScreen.getLocalizedString("gui.cancel")); daf6 = new RealmsResetWorldScreen(this, realmsServer, this.getNewScreen(), RealmsScreen.getLocalizedString("mco.configure.world.switch.slot"), RealmsScreen.getLocalizedString("mco.configure.world.switch.slot.subtitle"), 10526880, RealmsScreen.getLocalizedString("gui.cancel"));
dad6.setSlot(integer); daf6.setSlot(integer);
dad6.setResetTitle(RealmsScreen.getLocalizedString("mco.create.world.reset.title")); daf6.setResetTitle(RealmsScreen.getLocalizedString("mco.create.world.reset.title"));
Realms.setScreen(dad6); Realms.setScreen(daf6);
} }
else { else {
Realms.setScreen(this); Realms.setScreen(this);
@ -443,14 +443,14 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
final RealmsWorldOptions realmsWorldOptions2 = this.serverData.slots.get(this.serverData.activeSlot); final RealmsWorldOptions realmsWorldOptions2 = this.serverData.slots.get(this.serverData.activeSlot);
realmsWorldOptions.templateId = realmsWorldOptions2.templateId; realmsWorldOptions.templateId = realmsWorldOptions2.templateId;
realmsWorldOptions.templateImage = realmsWorldOptions2.templateImage; realmsWorldOptions.templateImage = realmsWorldOptions2.templateImage;
final RealmsClient cyv4 = RealmsClient.createRealmsClient(); final RealmsClient cyy4 = RealmsClient.createRealmsClient();
try { try {
cyv4.updateSlot(this.serverData.id, this.serverData.activeSlot, realmsWorldOptions); cyy4.updateSlot(this.serverData.id, this.serverData.activeSlot, realmsWorldOptions);
this.serverData.slots.put(this.serverData.activeSlot, realmsWorldOptions); this.serverData.slots.put(this.serverData.activeSlot, realmsWorldOptions);
} }
catch (RealmsServiceException czd5) { catch (RealmsServiceException czg5) {
RealmsConfigureWorldScreen.LOGGER.error("Couldn't save slot settings"); RealmsConfigureWorldScreen.LOGGER.error("Couldn't save slot settings");
Realms.setScreen(new RealmsGenericErrorScreen(czd5, this)); Realms.setScreen(new RealmsGenericErrorScreen(czg5, this));
return; return;
} }
catch (UnsupportedEncodingException unsupportedEncodingException5) { catch (UnsupportedEncodingException unsupportedEncodingException5) {
@ -461,15 +461,15 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
public void saveSettings(final String string1, final String string2) { public void saveSettings(final String string1, final String string2) {
final String string3 = (string2 == null || string2.trim().isEmpty()) ? null : string2; final String string3 = (string2 == null || string2.trim().isEmpty()) ? null : string2;
final RealmsClient cyv5 = RealmsClient.createRealmsClient(); final RealmsClient cyy5 = RealmsClient.createRealmsClient();
try { try {
cyv5.update(this.serverData.id, string1, string3); cyy5.update(this.serverData.id, string1, string3);
this.serverData.setName(string1); this.serverData.setName(string1);
this.serverData.setDescription(string3); this.serverData.setDescription(string3);
} }
catch (RealmsServiceException czd6) { catch (RealmsServiceException czg6) {
RealmsConfigureWorldScreen.LOGGER.error("Couldn't save settings"); RealmsConfigureWorldScreen.LOGGER.error("Couldn't save settings");
Realms.setScreen(new RealmsGenericErrorScreen(czd6, this)); Realms.setScreen(new RealmsGenericErrorScreen(czg6, this));
return; return;
} }
catch (UnsupportedEncodingException unsupportedEncodingException6) { catch (UnsupportedEncodingException unsupportedEncodingException6) {
@ -480,16 +480,16 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
public void openTheWorld(final boolean boolean1, final RealmsScreen realmsScreen) { public void openTheWorld(final boolean boolean1, final RealmsScreen realmsScreen) {
final RealmsTasks.OpenServerTask c4 = new RealmsTasks.OpenServerTask(this.serverData, this, this.lastScreen, boolean1); final RealmsTasks.OpenServerTask c4 = new RealmsTasks.OpenServerTask(this.serverData, this, this.lastScreen, boolean1);
final RealmsLongRunningMcoTaskScreen czx5 = new RealmsLongRunningMcoTaskScreen(realmsScreen, c4); final RealmsLongRunningMcoTaskScreen czz5 = new RealmsLongRunningMcoTaskScreen(realmsScreen, c4);
czx5.start(); czz5.start();
Realms.setScreen(czx5); Realms.setScreen(czz5);
} }
public void closeTheWorld(final RealmsScreen realmsScreen) { public void closeTheWorld(final RealmsScreen realmsScreen) {
final RealmsTasks.CloseServerTask a3 = new RealmsTasks.CloseServerTask(this.serverData, this); final RealmsTasks.CloseServerTask a3 = new RealmsTasks.CloseServerTask(this.serverData, this);
final RealmsLongRunningMcoTaskScreen czx4 = new RealmsLongRunningMcoTaskScreen(realmsScreen, a3); final RealmsLongRunningMcoTaskScreen czz4 = new RealmsLongRunningMcoTaskScreen(realmsScreen, a3);
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
public void stateChanged() { public void stateChanged() {
@ -507,18 +507,18 @@ public class RealmsConfigureWorldScreen extends RealmsScreenWithCallback<WorldTe
} }
private void switchSlot(final long long1, final int integer) { private void switchSlot(final long long1, final int integer) {
final RealmsConfigureWorldScreen czp5 = this.getNewScreen(); final RealmsConfigureWorldScreen czs5 = this.getNewScreen();
final RealmsTasks.SwitchSlotTask i6 = new RealmsTasks.SwitchSlotTask(long1, integer, (boolean2, integer) -> Realms.setScreen(czp5), 11); final RealmsTasks.SwitchSlotTask i6 = new RealmsTasks.SwitchSlotTask(long1, integer, (boolean2, integer) -> Realms.setScreen(czs5), 11);
final RealmsLongRunningMcoTaskScreen czx7 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, i6); final RealmsLongRunningMcoTaskScreen czz7 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, i6);
czx7.start(); czz7.start();
Realms.setScreen(czx7); Realms.setScreen(czz7);
} }
private void switchMinigame(final WorldTemplate worldTemplate) { private void switchMinigame(final WorldTemplate worldTemplate) {
final RealmsTasks.SwitchMinigameTask h3 = new RealmsTasks.SwitchMinigameTask(this.serverData.id, worldTemplate, this.getNewScreen()); final RealmsTasks.SwitchMinigameTask h3 = new RealmsTasks.SwitchMinigameTask(this.serverData.id, worldTemplate, this.getNewScreen());
final RealmsLongRunningMcoTaskScreen czx4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, h3); final RealmsLongRunningMcoTaskScreen czz4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, h3);
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
public RealmsConfigureWorldScreen getNewScreen() { public RealmsConfigureWorldScreen getNewScreen() {

View File

@ -20,9 +20,9 @@ public class RealmsCreateRealmScreen extends RealmsScreen {
private RealmsButton createButton; private RealmsButton createButton;
private RealmsLabel createRealmLabel; private RealmsLabel createRealmLabel;
public RealmsCreateRealmScreen(final RealmsServer realmsServer, final RealmsMainScreen cyr) { public RealmsCreateRealmScreen(final RealmsServer realmsServer, final RealmsMainScreen cyu) {
this.server = realmsServer; this.server = realmsServer;
this.lastScreen = cyr; this.lastScreen = cyu;
} }
@Override @Override
@ -85,12 +85,12 @@ public class RealmsCreateRealmScreen extends RealmsScreen {
private void createWorld() { private void createWorld() {
if (this.valid()) { if (this.valid()) {
final RealmsResetWorldScreen dad2 = new RealmsResetWorldScreen(this.lastScreen, this.server, this.lastScreen.newScreen(), RealmsScreen.getLocalizedString("mco.selectServer.create"), RealmsScreen.getLocalizedString("mco.create.world.subtitle"), 10526880, RealmsScreen.getLocalizedString("mco.create.world.skip")); final RealmsResetWorldScreen daf2 = new RealmsResetWorldScreen(this.lastScreen, this.server, this.lastScreen.newScreen(), RealmsScreen.getLocalizedString("mco.selectServer.create"), RealmsScreen.getLocalizedString("mco.create.world.subtitle"), 10526880, RealmsScreen.getLocalizedString("mco.create.world.skip"));
dad2.setResetTitle(RealmsScreen.getLocalizedString("mco.create.world.reset.title")); daf2.setResetTitle(RealmsScreen.getLocalizedString("mco.create.world.reset.title"));
final RealmsTasks.WorldCreationTask k3 = new RealmsTasks.WorldCreationTask(this.server.id, this.nameBox.getValue(), this.descriptionBox.getValue(), dad2); final RealmsTasks.WorldCreationTask j3 = new RealmsTasks.WorldCreationTask(this.server.id, this.nameBox.getValue(), this.descriptionBox.getValue(), daf2);
final RealmsLongRunningMcoTaskScreen czx4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, k3); final RealmsLongRunningMcoTaskScreen czz4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, j3);
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
} }

View File

@ -1,112 +0,0 @@
package com.mojang.realmsclient.gui.screens;
import com.mojang.realmsclient.gui.LongRunningTask;
import com.mojang.realmsclient.util.RealmsTasks;
import net.minecraft.realms.Realms;
import net.minecraft.realms.AbstractRealmsButton;
import net.minecraft.realms.RealmsGuiEventListener;
import net.minecraft.realms.RealmsButton;
import net.minecraft.realms.RealmsEditBox;
import com.mojang.realmsclient.RealmsMainScreen;
import net.minecraft.realms.RealmsScreen;
public class RealmsCreateTrialScreen extends RealmsScreen {
private final RealmsMainScreen lastScreen;
private RealmsEditBox nameBox;
private RealmsEditBox descriptionBox;
private boolean initialized;
private RealmsButton createButton;
public RealmsCreateTrialScreen(final RealmsMainScreen cyr) {
this.lastScreen = cyr;
}
@Override
public void tick() {
if (this.nameBox != null) {
this.nameBox.tick();
this.createButton.active(this.valid());
}
if (this.descriptionBox != null) {
this.descriptionBox.tick();
}
}
@Override
public void init() {
this.setKeyboardHandlerSendRepeatsToGui(true);
if (!this.initialized) {
this.initialized = true;
this.focusOn(this.nameBox = this.newEditBox(3, this.width() / 2 - 100, 65, 200, 20, RealmsScreen.getLocalizedString("mco.configure.world.name")));
this.descriptionBox = this.newEditBox(4, this.width() / 2 - 100, 115, 200, 20, RealmsScreen.getLocalizedString("mco.configure.world.description"));
}
this.buttonsAdd(this.createButton = new RealmsButton(0, this.width() / 2 - 100, this.height() / 4 + 120 + 17, 97, 20, RealmsScreen.getLocalizedString("mco.create.world")) {
@Override
public void onPress() {
RealmsCreateTrialScreen.this.createWorld();
}
});
this.buttonsAdd(new RealmsButton(1, this.width() / 2 + 5, this.height() / 4 + 120 + 17, 95, 20, RealmsScreen.getLocalizedString("gui.cancel")) {
@Override
public void onPress() {
Realms.setScreen(RealmsCreateTrialScreen.this.lastScreen);
}
});
this.createButton.active(this.valid());
this.addWidget(this.nameBox);
this.addWidget(this.descriptionBox);
}
@Override
public void removed() {
this.setKeyboardHandlerSendRepeatsToGui(false);
}
@Override
public boolean charTyped(final char character, final int integer) {
this.createButton.active(this.valid());
return false;
}
@Override
public boolean keyPressed(final int integer1, final int integer2, final int integer3) {
switch (integer1) {
case 256: {
Realms.setScreen(this.lastScreen);
return true;
}
default: {
this.createButton.active(this.valid());
return false;
}
}
}
private void createWorld() {
if (this.valid()) {
final RealmsTasks.TrialCreationTask j2 = new RealmsTasks.TrialCreationTask(this.nameBox.getValue(), this.descriptionBox.getValue(), this.lastScreen);
final RealmsLongRunningMcoTaskScreen czx3 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, j2);
czx3.start();
Realms.setScreen(czx3);
}
}
private boolean valid() {
return this.nameBox != null && this.nameBox.getValue() != null && !this.nameBox.getValue().trim().isEmpty();
}
@Override
public void render(final int integer1, final int integer2, final float float3) {
this.renderBackground();
this.drawCenteredString(RealmsScreen.getLocalizedString("mco.trial.title"), this.width() / 2, 11, 16777215);
this.drawString(RealmsScreen.getLocalizedString("mco.configure.world.name"), this.width() / 2 - 100, 52, 10526880);
this.drawString(RealmsScreen.getLocalizedString("mco.configure.world.description"), this.width() / 2 - 100, 102, 10526880);
if (this.nameBox != null) {
this.nameBox.render(integer1, integer2, float3);
}
if (this.descriptionBox != null) {
this.descriptionBox.render(integer1, integer2, float3);
}
super.render(integer1, integer2, float3);
}
}

View File

@ -96,8 +96,8 @@ public class RealmsDownloadLatestWorldScreen extends RealmsScreen {
} }
private long getContentLength(final String string) { private long getContentLength(final String string) {
final FileDownload cys3 = new FileDownload(); final FileDownload cyv3 = new FileDownload();
return cys3.contentLength(string); return cyv3.contentLength(string);
} }
@Override @Override
@ -234,7 +234,7 @@ public class RealmsDownloadLatestWorldScreen extends RealmsScreen {
} }
private void downloadSave() { private void downloadSave() {
FileDownload cys2; FileDownload cyv2;
new Thread(() -> { new Thread(() -> {
try { try {
if (!(!RealmsDownloadLatestWorldScreen.downloadLock.tryLock(1L, TimeUnit.SECONDS))) { if (!(!RealmsDownloadLatestWorldScreen.downloadLock.tryLock(1L, TimeUnit.SECONDS))) {
@ -244,22 +244,22 @@ public class RealmsDownloadLatestWorldScreen extends RealmsScreen {
} }
else { else {
this.status = RealmsScreen.getLocalizedString("mco.download.downloading", this.worldName); this.status = RealmsScreen.getLocalizedString("mco.download.downloading", this.worldName);
cys2 = new FileDownload(); cyv2 = new FileDownload();
cys2.contentLength(this.worldDownload.downloadLink); cyv2.contentLength(this.worldDownload.downloadLink);
cys2.download(this.worldDownload, this.worldName, this.downloadStatus, this.getLevelStorageSource()); cyv2.download(this.worldDownload, this.worldName, this.downloadStatus, this.getLevelStorageSource());
while (!cys2.isFinished()) { while (!cyv2.isFinished()) {
if (cys2.isError()) { if (cyv2.isError()) {
cys2.cancel(); cyv2.cancel();
this.errorMessage = RealmsScreen.getLocalizedString("mco.download.failed"); this.errorMessage = RealmsScreen.getLocalizedString("mco.download.failed");
this.cancelButton.setMessage(RealmsScreen.getLocalizedString("gui.done")); this.cancelButton.setMessage(RealmsScreen.getLocalizedString("gui.done"));
return; return;
} }
else { else {
if (cys2.isExtracting()) { if (cyv2.isExtracting()) {
this.extracting = true; this.extracting = true;
} }
if (this.cancelled) { if (this.cancelled) {
cys2.cancel(); cyv2.cancel();
this.downloadCancelled(); this.downloadCancelled();
return; return;
} }

View File

@ -11,9 +11,9 @@ public class RealmsGenericErrorScreen extends RealmsScreen {
private String line1; private String line1;
private String line2; private String line2;
public RealmsGenericErrorScreen(final RealmsServiceException czd, final RealmsScreen realmsScreen) { public RealmsGenericErrorScreen(final RealmsServiceException czg, final RealmsScreen realmsScreen) {
this.nextScreen = realmsScreen; this.nextScreen = realmsScreen;
this.errorMessage(czd); this.errorMessage(czg);
} }
public RealmsGenericErrorScreen(final String string, final RealmsScreen realmsScreen) { public RealmsGenericErrorScreen(final String string, final RealmsScreen realmsScreen) {
@ -26,16 +26,16 @@ public class RealmsGenericErrorScreen extends RealmsScreen {
this.errorMessage(string1, string2); this.errorMessage(string1, string2);
} }
private void errorMessage(final RealmsServiceException czd) { private void errorMessage(final RealmsServiceException czg) {
if (czd.errorCode == -1) { if (czg.errorCode == -1) {
this.line1 = "An error occurred (" + czd.httpResultCode + "):"; this.line1 = "An error occurred (" + czg.httpResultCode + "):";
this.line2 = czd.httpResponseContent; this.line2 = czg.httpResponseContent;
} }
else { else {
this.line1 = "Realms (" + czd.errorCode + "):"; this.line1 = "Realms (" + czg.errorCode + "):";
final String string3 = "mco.errorMessage." + czd.errorCode; final String string3 = "mco.errorMessage." + czg.errorCode;
final String string4 = RealmsScreen.getLocalizedString(string3); final String string4 = RealmsScreen.getLocalizedString(string3);
this.line2 = (string4.equals(string3) ? czd.errorMsg : string4); this.line2 = (string4.equals(string3) ? czg.errorMsg : string4);
} }
} }

View File

@ -25,8 +25,8 @@ public class RealmsInviteScreen extends RealmsScreen {
private String errorMsg; private String errorMsg;
private boolean showError; private boolean showError;
public RealmsInviteScreen(final RealmsConfigureWorldScreen czp, final RealmsScreen realmsScreen, final RealmsServer realmsServer) { public RealmsInviteScreen(final RealmsConfigureWorldScreen czs, final RealmsScreen realmsScreen, final RealmsServer realmsServer) {
this.configureScreen = czp; this.configureScreen = czs;
this.lastScreen = realmsScreen; this.lastScreen = realmsScreen;
this.serverData = realmsServer; this.serverData = realmsServer;
} }
@ -61,13 +61,13 @@ public class RealmsInviteScreen extends RealmsScreen {
} }
private void onInvite() { private void onInvite() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
if (this.profileName.getValue() == null || this.profileName.getValue().isEmpty()) { if (this.profileName.getValue() == null || this.profileName.getValue().isEmpty()) {
this.showError(RealmsScreen.getLocalizedString("mco.configure.world.players.error")); this.showError(RealmsScreen.getLocalizedString("mco.configure.world.players.error"));
return; return;
} }
try { try {
final RealmsServer realmsServer3 = cyv2.invite(this.serverData.id, this.profileName.getValue().trim()); final RealmsServer realmsServer3 = cyy2.invite(this.serverData.id, this.profileName.getValue().trim());
if (realmsServer3 != null) { if (realmsServer3 != null) {
this.serverData.players = realmsServer3.players; this.serverData.players = realmsServer3.players;
Realms.setScreen(new RealmsPlayerScreen(this.configureScreen, this.serverData)); Realms.setScreen(new RealmsPlayerScreen(this.configureScreen, this.serverData));

View File

@ -25,11 +25,11 @@ public class RealmsLongRunningMcoTaskScreen extends RealmsScreen {
private final int buttonLength = 212; private final int buttonLength = 212;
public static final String[] symbols; public static final String[] symbols;
public RealmsLongRunningMcoTaskScreen(final RealmsScreen realmsScreen, final LongRunningTask czg) { public RealmsLongRunningMcoTaskScreen(final RealmsScreen realmsScreen, final LongRunningTask czj) {
this.title = ""; this.title = "";
this.lastScreen = realmsScreen; this.lastScreen = realmsScreen;
(this.task = czg).setScreen(this); (this.task = czj).setScreen(this);
this.taskThread = czg; this.taskThread = czj;
} }
public void start() { public void start() {

View File

@ -55,15 +55,15 @@ public class RealmsNotificationsScreen extends RealmsScreen {
new Thread("Realms Notification Availability checker #1") { new Thread("Realms Notification Availability checker #1") {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
try { try {
final RealmsClient.CompatibleVersionResponse a3 = cyv2.clientCompatible(); final RealmsClient.CompatibleVersionResponse a3 = cyy2.clientCompatible();
if (!a3.equals(RealmsClient.CompatibleVersionResponse.COMPATIBLE)) { if (!a3.equals(RealmsClient.CompatibleVersionResponse.COMPATIBLE)) {
return; return;
} }
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
if (czd3.httpResultCode != 401) { if (czg3.httpResultCode != 401) {
RealmsNotificationsScreen.checkedMcoAvailability = false; RealmsNotificationsScreen.checkedMcoAvailability = false;
} }
return; return;

View File

@ -47,13 +47,13 @@ public class RealmsPendingInvitesScreen extends RealmsScreen {
new Thread("Realms-pending-invitations-fetcher") { new Thread("Realms-pending-invitations-fetcher") {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
try { try {
final List<PendingInvite> list3 = cyv2.pendingInvites().pendingInvites; final List<PendingInvite> list3 = cyy2.pendingInvites().pendingInvites;
final List<PendingInvitationSelectionListEntry> list4 = list3.stream().map(pendingInvite -> new PendingInvitationSelectionListEntry(pendingInvite)).collect(Collectors.toList()); final List<PendingInvitationSelectionListEntry> list4 = list3.stream().map(pendingInvite -> new PendingInvitationSelectionListEntry(pendingInvite)).collect(Collectors.toList());
Realms.execute(() -> RealmsPendingInvitesScreen.this.pendingInvitationSelectionList.replaceEntries(list4)); Realms.execute(() -> RealmsPendingInvitesScreen.this.pendingInvitationSelectionList.replaceEntries(list4));
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
RealmsPendingInvitesScreen.LOGGER.error("Couldn't list invites"); RealmsPendingInvitesScreen.LOGGER.error("Couldn't list invites");
} }
finally { finally {
@ -113,11 +113,11 @@ public class RealmsPendingInvitesScreen extends RealmsScreen {
@Override @Override
public void run() { public void run() {
try { try {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
cyv2.rejectInvitation(RealmsPendingInvitesScreen.this.pendingInvitationSelectionList.children().get(integer).pendingInvite.invitationId); cyy2.rejectInvitation(RealmsPendingInvitesScreen.this.pendingInvitationSelectionList.children().get(integer).pendingInvite.invitationId);
Realms.execute(() -> RealmsPendingInvitesScreen.this.updateList(integer)); Realms.execute(() -> RealmsPendingInvitesScreen.this.updateList(integer));
} }
catch (RealmsServiceException czd2) { catch (RealmsServiceException czg2) {
RealmsPendingInvitesScreen.LOGGER.error("Couldn't reject invite"); RealmsPendingInvitesScreen.LOGGER.error("Couldn't reject invite");
} }
} }
@ -131,11 +131,11 @@ public class RealmsPendingInvitesScreen extends RealmsScreen {
@Override @Override
public void run() { public void run() {
try { try {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
cyv2.acceptInvitation(RealmsPendingInvitesScreen.this.pendingInvitationSelectionList.children().get(integer).pendingInvite.invitationId); cyy2.acceptInvitation(RealmsPendingInvitesScreen.this.pendingInvitationSelectionList.children().get(integer).pendingInvite.invitationId);
Realms.execute(() -> RealmsPendingInvitesScreen.this.updateList(integer)); Realms.execute(() -> RealmsPendingInvitesScreen.this.updateList(integer));
} }
catch (RealmsServiceException czd2) { catch (RealmsServiceException czg2) {
RealmsPendingInvitesScreen.LOGGER.error("Couldn't accept invite"); RealmsPendingInvitesScreen.LOGGER.error("Couldn't accept invite");
} }
} }

View File

@ -39,10 +39,10 @@ public class RealmsPlayerScreen extends RealmsScreen {
private boolean stateChanged; private boolean stateChanged;
private RealmsLabel titleLabel; private RealmsLabel titleLabel;
public RealmsPlayerScreen(final RealmsConfigureWorldScreen czp, final RealmsServer realmsServer) { public RealmsPlayerScreen(final RealmsConfigureWorldScreen czs, final RealmsServer realmsServer) {
this.selectedInvitedIndex = -1; this.selectedInvitedIndex = -1;
this.player = -1; this.player = -1;
this.lastScreen = czp; this.lastScreen = czs;
this.serverData = realmsServer; this.serverData = realmsServer;
} }
@ -130,24 +130,24 @@ public class RealmsPlayerScreen extends RealmsScreen {
private void op(final int integer) { private void op(final int integer) {
this.updateButtonStates(); this.updateButtonStates();
final RealmsClient cyv3 = RealmsClient.createRealmsClient(); final RealmsClient cyy3 = RealmsClient.createRealmsClient();
final String string4 = this.serverData.players.get(integer).getUuid(); final String string4 = this.serverData.players.get(integer).getUuid();
try { try {
this.updateOps(cyv3.op(this.serverData.id, string4)); this.updateOps(cyy3.op(this.serverData.id, string4));
} }
catch (RealmsServiceException czd5) { catch (RealmsServiceException czg5) {
RealmsPlayerScreen.LOGGER.error("Couldn't op the user"); RealmsPlayerScreen.LOGGER.error("Couldn't op the user");
} }
} }
private void deop(final int integer) { private void deop(final int integer) {
this.updateButtonStates(); this.updateButtonStates();
final RealmsClient cyv3 = RealmsClient.createRealmsClient(); final RealmsClient cyy3 = RealmsClient.createRealmsClient();
final String string4 = this.serverData.players.get(integer).getUuid(); final String string4 = this.serverData.players.get(integer).getUuid();
try { try {
this.updateOps(cyv3.deop(this.serverData.id, string4)); this.updateOps(cyy3.deop(this.serverData.id, string4));
} }
catch (RealmsServiceException czd5) { catch (RealmsServiceException czg5) {
RealmsPlayerScreen.LOGGER.error("Couldn't deop the user"); RealmsPlayerScreen.LOGGER.error("Couldn't deop the user");
} }
} }
@ -164,8 +164,8 @@ public class RealmsPlayerScreen extends RealmsScreen {
final PlayerInfo playerInfo3 = this.serverData.players.get(integer); final PlayerInfo playerInfo3 = this.serverData.players.get(integer);
this.selectedInvited = playerInfo3.getUuid(); this.selectedInvited = playerInfo3.getUuid();
this.selectedInvitedIndex = integer; this.selectedInvitedIndex = integer;
final RealmsConfirmScreen czq4 = new RealmsConfirmScreen(this, "Question", RealmsScreen.getLocalizedString("mco.configure.world.uninvite.question") + " '" + playerInfo3.getName() + "' ?", 2); final RealmsConfirmScreen czt4 = new RealmsConfirmScreen(this, "Question", RealmsScreen.getLocalizedString("mco.configure.world.uninvite.question") + " '" + playerInfo3.getName() + "' ?", 2);
Realms.setScreen(czq4); Realms.setScreen(czt4);
} }
} }
@ -173,11 +173,11 @@ public class RealmsPlayerScreen extends RealmsScreen {
public void confirmResult(final boolean boolean1, final int integer) { public void confirmResult(final boolean boolean1, final int integer) {
if (integer == 2) { if (integer == 2) {
if (boolean1) { if (boolean1) {
final RealmsClient cyv4 = RealmsClient.createRealmsClient(); final RealmsClient cyy4 = RealmsClient.createRealmsClient();
try { try {
cyv4.uninvite(this.serverData.id, this.selectedInvited); cyy4.uninvite(this.serverData.id, this.selectedInvited);
} }
catch (RealmsServiceException czd5) { catch (RealmsServiceException czg5) {
RealmsPlayerScreen.LOGGER.error("Couldn't uninvite user"); RealmsPlayerScreen.LOGGER.error("Couldn't uninvite user");
} }
this.deleteFromInvitedList(this.selectedInvitedIndex); this.deleteFromInvitedList(this.selectedInvitedIndex);

View File

@ -24,15 +24,15 @@ public class RealmsResetNormalWorldScreen extends RealmsScreen {
private RealmsButton generateStructuresButton; private RealmsButton generateStructuresButton;
private String buttonTitle; private String buttonTitle;
public RealmsResetNormalWorldScreen(final RealmsResetWorldScreen dad) { public RealmsResetNormalWorldScreen(final RealmsResetWorldScreen daf) {
this.generateStructures = true; this.generateStructures = true;
this.levelTypeIndex = 0; this.levelTypeIndex = 0;
this.buttonTitle = RealmsScreen.getLocalizedString("mco.backup.button.reset"); this.buttonTitle = RealmsScreen.getLocalizedString("mco.backup.button.reset");
this.lastScreen = dad; this.lastScreen = daf;
} }
public RealmsResetNormalWorldScreen(final RealmsResetWorldScreen dad, final String string) { public RealmsResetNormalWorldScreen(final RealmsResetWorldScreen daf, final String string) {
this(dad); this(daf);
this.buttonTitle = string; this.buttonTitle = string;
} }

View File

@ -88,12 +88,12 @@ public class RealmsResetWorldScreen extends RealmsScreenWithCallback<WorldTempla
new Thread("Realms-reset-world-fetcher") { new Thread("Realms-reset-world-fetcher") {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
try { try {
final WorldTemplatePaginatedList worldTemplatePaginatedList3 = cyv2.fetchWorldTemplates(1, 10, RealmsServer.WorldType.NORMAL); final WorldTemplatePaginatedList worldTemplatePaginatedList3 = cyy2.fetchWorldTemplates(1, 10, RealmsServer.WorldType.NORMAL);
final WorldTemplatePaginatedList worldTemplatePaginatedList4 = cyv2.fetchWorldTemplates(1, 10, RealmsServer.WorldType.ADVENTUREMAP); final WorldTemplatePaginatedList worldTemplatePaginatedList4 = cyy2.fetchWorldTemplates(1, 10, RealmsServer.WorldType.ADVENTUREMAP);
final WorldTemplatePaginatedList worldTemplatePaginatedList5 = cyv2.fetchWorldTemplates(1, 10, RealmsServer.WorldType.EXPERIENCE); final WorldTemplatePaginatedList worldTemplatePaginatedList5 = cyy2.fetchWorldTemplates(1, 10, RealmsServer.WorldType.EXPERIENCE);
final WorldTemplatePaginatedList worldTemplatePaginatedList6 = cyv2.fetchWorldTemplates(1, 10, RealmsServer.WorldType.INSPIRATION); final WorldTemplatePaginatedList worldTemplatePaginatedList6 = cyy2.fetchWorldTemplates(1, 10, RealmsServer.WorldType.INSPIRATION);
final WorldTemplatePaginatedList worldTemplatePaginatedList7; final WorldTemplatePaginatedList worldTemplatePaginatedList7;
final WorldTemplatePaginatedList worldTemplatePaginatedList8; final WorldTemplatePaginatedList worldTemplatePaginatedList8;
final WorldTemplatePaginatedList worldTemplatePaginatedList9; final WorldTemplatePaginatedList worldTemplatePaginatedList9;
@ -105,8 +105,8 @@ public class RealmsResetWorldScreen extends RealmsScreenWithCallback<WorldTempla
RealmsResetWorldScreen.this.inspirations = worldTemplatePaginatedList10; RealmsResetWorldScreen.this.inspirations = worldTemplatePaginatedList10;
}); });
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
RealmsResetWorldScreen.LOGGER.error("Couldn't fetch templates in reset world", (Throwable)czd3); RealmsResetWorldScreen.LOGGER.error("Couldn't fetch templates in reset world", (Throwable)czg3);
} }
} }
}.start(); }.start();
@ -127,33 +127,33 @@ public class RealmsResetWorldScreen extends RealmsScreenWithCallback<WorldTempla
this.buttonsAdd(new FrameButton(this.frame(3), RealmsConstants.row(0) + 10, RealmsScreen.getLocalizedString("mco.reset.world.template"), -1L, "realms:textures/gui/realms/survival_spawn.png", ResetType.SURVIVAL_SPAWN) { this.buttonsAdd(new FrameButton(this.frame(3), RealmsConstants.row(0) + 10, RealmsScreen.getLocalizedString("mco.reset.world.template"), -1L, "realms:textures/gui/realms/survival_spawn.png", ResetType.SURVIVAL_SPAWN) {
@Override @Override
public void onPress() { public void onPress() {
final RealmsSelectWorldTemplateScreen dah2 = new RealmsSelectWorldTemplateScreen(RealmsResetWorldScreen.this, RealmsServer.WorldType.NORMAL, RealmsResetWorldScreen.this.templates); final RealmsSelectWorldTemplateScreen daj2 = new RealmsSelectWorldTemplateScreen(RealmsResetWorldScreen.this, RealmsServer.WorldType.NORMAL, RealmsResetWorldScreen.this.templates);
dah2.setTitle(RealmsScreen.getLocalizedString("mco.reset.world.template")); daj2.setTitle(RealmsScreen.getLocalizedString("mco.reset.world.template"));
Realms.setScreen(dah2); Realms.setScreen(daj2);
} }
}); });
this.buttonsAdd(new FrameButton(this.frame(1), RealmsConstants.row(6) + 20, RealmsScreen.getLocalizedString("mco.reset.world.adventure"), -1L, "realms:textures/gui/realms/adventure.png", ResetType.ADVENTURE) { this.buttonsAdd(new FrameButton(this.frame(1), RealmsConstants.row(6) + 20, RealmsScreen.getLocalizedString("mco.reset.world.adventure"), -1L, "realms:textures/gui/realms/adventure.png", ResetType.ADVENTURE) {
@Override @Override
public void onPress() { public void onPress() {
final RealmsSelectWorldTemplateScreen dah2 = new RealmsSelectWorldTemplateScreen(RealmsResetWorldScreen.this, RealmsServer.WorldType.ADVENTUREMAP, RealmsResetWorldScreen.this.adventuremaps); final RealmsSelectWorldTemplateScreen daj2 = new RealmsSelectWorldTemplateScreen(RealmsResetWorldScreen.this, RealmsServer.WorldType.ADVENTUREMAP, RealmsResetWorldScreen.this.adventuremaps);
dah2.setTitle(RealmsScreen.getLocalizedString("mco.reset.world.adventure")); daj2.setTitle(RealmsScreen.getLocalizedString("mco.reset.world.adventure"));
Realms.setScreen(dah2); Realms.setScreen(daj2);
} }
}); });
this.buttonsAdd(new FrameButton(this.frame(2), RealmsConstants.row(6) + 20, RealmsScreen.getLocalizedString("mco.reset.world.experience"), -1L, "realms:textures/gui/realms/experience.png", ResetType.EXPERIENCE) { this.buttonsAdd(new FrameButton(this.frame(2), RealmsConstants.row(6) + 20, RealmsScreen.getLocalizedString("mco.reset.world.experience"), -1L, "realms:textures/gui/realms/experience.png", ResetType.EXPERIENCE) {
@Override @Override
public void onPress() { public void onPress() {
final RealmsSelectWorldTemplateScreen dah2 = new RealmsSelectWorldTemplateScreen(RealmsResetWorldScreen.this, RealmsServer.WorldType.EXPERIENCE, RealmsResetWorldScreen.this.experiences); final RealmsSelectWorldTemplateScreen daj2 = new RealmsSelectWorldTemplateScreen(RealmsResetWorldScreen.this, RealmsServer.WorldType.EXPERIENCE, RealmsResetWorldScreen.this.experiences);
dah2.setTitle(RealmsScreen.getLocalizedString("mco.reset.world.experience")); daj2.setTitle(RealmsScreen.getLocalizedString("mco.reset.world.experience"));
Realms.setScreen(dah2); Realms.setScreen(daj2);
} }
}); });
this.buttonsAdd(new FrameButton(this.frame(3), RealmsConstants.row(6) + 20, RealmsScreen.getLocalizedString("mco.reset.world.inspiration"), -1L, "realms:textures/gui/realms/inspiration.png", ResetType.INSPIRATION) { this.buttonsAdd(new FrameButton(this.frame(3), RealmsConstants.row(6) + 20, RealmsScreen.getLocalizedString("mco.reset.world.inspiration"), -1L, "realms:textures/gui/realms/inspiration.png", ResetType.INSPIRATION) {
@Override @Override
public void onPress() { public void onPress() {
final RealmsSelectWorldTemplateScreen dah2 = new RealmsSelectWorldTemplateScreen(RealmsResetWorldScreen.this, RealmsServer.WorldType.INSPIRATION, RealmsResetWorldScreen.this.inspirations); final RealmsSelectWorldTemplateScreen daj2 = new RealmsSelectWorldTemplateScreen(RealmsResetWorldScreen.this, RealmsServer.WorldType.INSPIRATION, RealmsResetWorldScreen.this.inspirations);
dah2.setTitle(RealmsScreen.getLocalizedString("mco.reset.world.inspiration")); daj2.setTitle(RealmsScreen.getLocalizedString("mco.reset.world.inspiration"));
Realms.setScreen(dah2); Realms.setScreen(daj2);
} }
}); });
this.narrateLabels(); this.narrateLabels();
@ -252,9 +252,9 @@ public class RealmsResetWorldScreen extends RealmsScreenWithCallback<WorldTempla
public void switchSlot(final RealmsScreen realmsScreen) { public void switchSlot(final RealmsScreen realmsScreen) {
final RealmsTasks.SwitchSlotTask i3 = new RealmsTasks.SwitchSlotTask(this.serverData.id, this.slot, realmsScreen, 100); final RealmsTasks.SwitchSlotTask i3 = new RealmsTasks.SwitchSlotTask(this.serverData.id, this.slot, realmsScreen, 100);
final RealmsLongRunningMcoTaskScreen czx4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, i3); final RealmsLongRunningMcoTaskScreen czz4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, i3);
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
@Override @Override
@ -298,9 +298,9 @@ public class RealmsResetWorldScreen extends RealmsScreenWithCallback<WorldTempla
if (this.confirmationId != -1) { if (this.confirmationId != -1) {
f3.setConfirmationId(this.confirmationId); f3.setConfirmationId(this.confirmationId);
} }
final RealmsLongRunningMcoTaskScreen czx4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, f3); final RealmsLongRunningMcoTaskScreen czz4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, f3);
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
public void resetWorld(final ResetWorldInfo c) { public void resetWorld(final ResetWorldInfo c) {
@ -322,9 +322,9 @@ public class RealmsResetWorldScreen extends RealmsScreenWithCallback<WorldTempla
if (this.confirmationId != -1) { if (this.confirmationId != -1) {
f3.setConfirmationId(this.confirmationId); f3.setConfirmationId(this.confirmationId);
} }
final RealmsLongRunningMcoTaskScreen czx4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, f3); final RealmsLongRunningMcoTaskScreen czz4 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, f3);
czx4.start(); czz4.start();
Realms.setScreen(czx4); Realms.setScreen(czz4);
} }
static { static {

View File

@ -30,12 +30,12 @@ public class RealmsResourcePackScreen extends RealmsScreen {
else { else {
try { try {
final RealmsLongRunningMcoTaskScreen realmsLongRunningMcoTaskScreen; final RealmsLongRunningMcoTaskScreen realmsLongRunningMcoTaskScreen;
final RealmsLongRunningMcoTaskScreen czx2; final RealmsLongRunningMcoTaskScreen czz2;
Realms.downloadResourcePack(this.serverAddress.resourcePackUrl, this.serverAddress.resourcePackHash).thenRun(() -> { Realms.downloadResourcePack(this.serverAddress.resourcePackUrl, this.serverAddress.resourcePackHash).thenRun(() -> {
new RealmsLongRunningMcoTaskScreen(this.lastScreen, new RealmsTasks.RealmsConnectTask(this.lastScreen, this.serverAddress)); new RealmsLongRunningMcoTaskScreen(this.lastScreen, new RealmsTasks.RealmsConnectTask(this.lastScreen, this.serverAddress));
czx2 = realmsLongRunningMcoTaskScreen; czz2 = realmsLongRunningMcoTaskScreen;
czx2.start(); czz2.start();
Realms.setScreen(czx2); Realms.setScreen(czz2);
}).exceptionally(throwable -> { }).exceptionally(throwable -> {
Realms.clearResourcePack(); Realms.clearResourcePack();
RealmsResourcePackScreen.LOGGER.error(throwable); RealmsResourcePackScreen.LOGGER.error(throwable);

View File

@ -41,12 +41,12 @@ public class RealmsSelectFileToUploadScreen extends RealmsScreen {
private RealmsLabel subtitleLabel; private RealmsLabel subtitleLabel;
private RealmsLabel noWorldsLabel; private RealmsLabel noWorldsLabel;
public RealmsSelectFileToUploadScreen(final long long1, final int integer, final RealmsResetWorldScreen dad) { public RealmsSelectFileToUploadScreen(final long long1, final int integer, final RealmsResetWorldScreen daf) {
this.DATE_FORMAT = new SimpleDateFormat(); this.DATE_FORMAT = new SimpleDateFormat();
this.levelList = Lists.newArrayList(); this.levelList = Lists.newArrayList();
this.selectedWorld = -1; this.selectedWorld = -1;
this.gameModesLang = new String[4]; this.gameModesLang = new String[4];
this.lastScreen = dad; this.lastScreen = daf;
this.worldId = long1; this.worldId = long1;
this.slotId = integer; this.slotId = integer;
} }

View File

@ -52,13 +52,13 @@ public class RealmsSelectWorldTemplateScreen extends RealmsScreen {
private boolean hoverWarning; private boolean hoverWarning;
private List<TextRenderingUtils.Line> noTemplatesMessage; private List<TextRenderingUtils.Line> noTemplatesMessage;
public RealmsSelectWorldTemplateScreen(final RealmsScreenWithCallback<WorldTemplate> daf, final RealmsServer.WorldType c) { public RealmsSelectWorldTemplateScreen(final RealmsScreenWithCallback<WorldTemplate> dah, final RealmsServer.WorldType c) {
this(daf, c, null); this(dah, c, null);
} }
public RealmsSelectWorldTemplateScreen(final RealmsScreenWithCallback<WorldTemplate> daf, final RealmsServer.WorldType c, @Nullable final WorldTemplatePaginatedList worldTemplatePaginatedList) { public RealmsSelectWorldTemplateScreen(final RealmsScreenWithCallback<WorldTemplate> dah, final RealmsServer.WorldType c, @Nullable final WorldTemplatePaginatedList worldTemplatePaginatedList) {
this.selectedTemplate = -1; this.selectedTemplate = -1;
this.lastScreen = daf; this.lastScreen = dah;
this.worldType = c; this.worldType = c;
if (worldTemplatePaginatedList == null) { if (worldTemplatePaginatedList == null) {
this.worldTemplateObjectSelectionList = new WorldTemplateObjectSelectionList(); this.worldTemplateObjectSelectionList = new WorldTemplateObjectSelectionList();
@ -206,9 +206,9 @@ public class RealmsSelectWorldTemplateScreen extends RealmsScreen {
@Override @Override
public void run() { public void run() {
WorldTemplatePaginatedList worldTemplatePaginatedList2 = worldTemplatePaginatedList; WorldTemplatePaginatedList worldTemplatePaginatedList2 = worldTemplatePaginatedList;
final RealmsClient cyv3 = RealmsClient.createRealmsClient(); final RealmsClient cyy3 = RealmsClient.createRealmsClient();
while (worldTemplatePaginatedList2 != null) { while (worldTemplatePaginatedList2 != null) {
final Either<WorldTemplatePaginatedList, String> either4 = RealmsSelectWorldTemplateScreen.this.fetchTemplates(worldTemplatePaginatedList2, cyv3); final Either<WorldTemplatePaginatedList, String> either4 = RealmsSelectWorldTemplateScreen.this.fetchTemplates(worldTemplatePaginatedList2, cyy3);
final Either either5; final Either either5;
WorldTemplatePaginatedList worldTemplatePaginatedList3; WorldTemplatePaginatedList worldTemplatePaginatedList3;
final Iterator<WorldTemplate> iterator; final Iterator<WorldTemplate> iterator;
@ -251,12 +251,12 @@ public class RealmsSelectWorldTemplateScreen extends RealmsScreen {
}.start(); }.start();
} }
private Either<WorldTemplatePaginatedList, String> fetchTemplates(final WorldTemplatePaginatedList worldTemplatePaginatedList, final RealmsClient cyv) { private Either<WorldTemplatePaginatedList, String> fetchTemplates(final WorldTemplatePaginatedList worldTemplatePaginatedList, final RealmsClient cyy) {
try { try {
return (Either<WorldTemplatePaginatedList, String>)Either.left(cyv.fetchWorldTemplates(worldTemplatePaginatedList.page + 1, worldTemplatePaginatedList.size, this.worldType)); return (Either<WorldTemplatePaginatedList, String>)Either.left(cyy.fetchWorldTemplates(worldTemplatePaginatedList.page + 1, worldTemplatePaginatedList.size, this.worldType));
} }
catch (RealmsServiceException czd4) { catch (RealmsServiceException czg4) {
return (Either<WorldTemplatePaginatedList, String>)Either.right(czd4.getMessage()); return (Either<WorldTemplatePaginatedList, String>)Either.right(czg4.getMessage());
} }
} }
@ -336,8 +336,8 @@ public class RealmsSelectWorldTemplateScreen extends RealmsScreen {
} }
class WorldTemplateObjectSelectionList extends RealmsObjectSelectionList<WorldTemplateObjectSelectionListEntry> { class WorldTemplateObjectSelectionList extends RealmsObjectSelectionList<WorldTemplateObjectSelectionListEntry> {
public WorldTemplateObjectSelectionList(final RealmsSelectWorldTemplateScreen dah) { public WorldTemplateObjectSelectionList(final RealmsSelectWorldTemplateScreen daj) {
this(dah, Collections.emptyList()); this(daj, Collections.emptyList());
} }
public WorldTemplateObjectSelectionList(final Iterable<WorldTemplate> iterable) { public WorldTemplateObjectSelectionList(final Iterable<WorldTemplate> iterable) {

View File

@ -20,8 +20,8 @@ public class RealmsSettingsScreen extends RealmsScreen {
private RealmsEditBox nameEdit; private RealmsEditBox nameEdit;
private RealmsLabel titleLabel; private RealmsLabel titleLabel;
public RealmsSettingsScreen(final RealmsConfigureWorldScreen czp, final RealmsServer realmsServer) { public RealmsSettingsScreen(final RealmsConfigureWorldScreen czs, final RealmsServer realmsServer) {
this.configureWorldScreen = czp; this.configureWorldScreen = czs;
this.serverData = realmsServer; this.serverData = realmsServer;
} }

View File

@ -43,8 +43,8 @@ public class RealmsSlotOptionsScreen extends RealmsScreen {
private RealmsLabel titleLabel; private RealmsLabel titleLabel;
private RealmsLabel warningLabel; private RealmsLabel warningLabel;
public RealmsSlotOptionsScreen(final RealmsConfigureWorldScreen czp, final RealmsWorldOptions realmsWorldOptions, final RealmsServer.WorldType c, final int integer) { public RealmsSlotOptionsScreen(final RealmsConfigureWorldScreen czs, final RealmsWorldOptions realmsWorldOptions, final RealmsServer.WorldType c, final int integer) {
this.parent = czp; this.parent = czs;
this.options = realmsWorldOptions; this.options = realmsWorldOptions;
this.worldType = c; this.worldType = c;
this.activeSlot = integer; this.activeSlot = integer;

View File

@ -79,16 +79,16 @@ public class RealmsSubscriptionInfoScreen extends RealmsScreen {
} }
private void getSubscription(final long long1) { private void getSubscription(final long long1) {
final RealmsClient cyv4 = RealmsClient.createRealmsClient(); final RealmsClient cyy4 = RealmsClient.createRealmsClient();
try { try {
final Subscription subscription5 = cyv4.subscriptionFor(long1); final Subscription subscription5 = cyy4.subscriptionFor(long1);
this.daysLeft = subscription5.daysLeft; this.daysLeft = subscription5.daysLeft;
this.startDate = this.localPresentation(subscription5.startDate); this.startDate = this.localPresentation(subscription5.startDate);
this.type = subscription5.type; this.type = subscription5.type;
} }
catch (RealmsServiceException czd5) { catch (RealmsServiceException czg5) {
RealmsSubscriptionInfoScreen.LOGGER.error("Couldn't get subscription"); RealmsSubscriptionInfoScreen.LOGGER.error("Couldn't get subscription");
Realms.setScreen(new RealmsGenericErrorScreen(czd5, this.lastScreen)); Realms.setScreen(new RealmsGenericErrorScreen(czg5, this.lastScreen));
} }
catch (IOException iOException5) { catch (IOException iOException5) {
RealmsSubscriptionInfoScreen.LOGGER.error("Couldn't parse response subscribing"); RealmsSubscriptionInfoScreen.LOGGER.error("Couldn't parse response subscribing");
@ -102,12 +102,12 @@ public class RealmsSubscriptionInfoScreen extends RealmsScreen {
@Override @Override
public void run() { public void run() {
try { try {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
cyv2.deleteWorld(RealmsSubscriptionInfoScreen.this.serverData.id); cyy2.deleteWorld(RealmsSubscriptionInfoScreen.this.serverData.id);
} }
catch (RealmsServiceException czd2) { catch (RealmsServiceException czg2) {
RealmsSubscriptionInfoScreen.LOGGER.error("Couldn't delete world"); RealmsSubscriptionInfoScreen.LOGGER.error("Couldn't delete world");
RealmsSubscriptionInfoScreen.LOGGER.error(czd2); RealmsSubscriptionInfoScreen.LOGGER.error(czg2);
} }
catch (IOException iOException2) { catch (IOException iOException2) {
RealmsSubscriptionInfoScreen.LOGGER.error("Couldn't delete world"); RealmsSubscriptionInfoScreen.LOGGER.error("Couldn't delete world");

View File

@ -25,9 +25,9 @@ public class RealmsTermsScreen extends RealmsScreen {
private boolean onLink; private boolean onLink;
private final String realmsToSUrl = "https://minecraft.net/realms/terms"; private final String realmsToSUrl = "https://minecraft.net/realms/terms";
public RealmsTermsScreen(final RealmsScreen realmsScreen, final RealmsMainScreen cyr, final RealmsServer realmsServer) { public RealmsTermsScreen(final RealmsScreen realmsScreen, final RealmsMainScreen cyu, final RealmsServer realmsServer) {
this.lastScreen = realmsScreen; this.lastScreen = realmsScreen;
this.mainScreen = cyr; this.mainScreen = cyu;
this.realmsServer = realmsServer; this.realmsServer = realmsServer;
} }
@ -66,14 +66,14 @@ public class RealmsTermsScreen extends RealmsScreen {
} }
private void agreedToTos() { private void agreedToTos() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
try { try {
cyv2.agreeToTos(); cyy2.agreeToTos();
final RealmsLongRunningMcoTaskScreen czx3 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, new RealmsTasks.RealmsGetServerDetailsTask(this.mainScreen, this.lastScreen, this.realmsServer, new ReentrantLock())); final RealmsLongRunningMcoTaskScreen czz3 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, new RealmsTasks.RealmsGetServerDetailsTask(this.mainScreen, this.lastScreen, this.realmsServer, new ReentrantLock()));
czx3.start(); czz3.start();
Realms.setScreen(czx3); Realms.setScreen(czz3);
} }
catch (RealmsServiceException czd3) { catch (RealmsServiceException czg3) {
RealmsTermsScreen.LOGGER.error("Couldn't agree to TOS"); RealmsTermsScreen.LOGGER.error("Couldn't agree to TOS");
} }
} }

View File

@ -60,11 +60,11 @@ public class RealmsUploadScreen extends RealmsScreen {
private long bytesPersSecond; private long bytesPersSecond;
private static final ReentrantLock uploadLock; private static final ReentrantLock uploadLock;
public RealmsUploadScreen(final long long1, final int integer, final RealmsResetWorldScreen dad, final RealmsLevelSummary realmsLevelSummary) { public RealmsUploadScreen(final long long1, final int integer, final RealmsResetWorldScreen daf, final RealmsLevelSummary realmsLevelSummary) {
this.showDots = true; this.showDots = true;
this.worldId = long1; this.worldId = long1;
this.slotId = integer; this.slotId = integer;
this.lastScreen = dad; this.lastScreen = daf;
this.selectedLevel = realmsLevelSummary; this.selectedLevel = realmsLevelSummary;
this.uploadStatus = new UploadStatus(); this.uploadStatus = new UploadStatus();
this.narrationRateLimiter = RateLimiter.create(0.10000000149011612); this.narrationRateLimiter = RateLimiter.create(0.10000000149011612);
@ -269,7 +269,7 @@ public class RealmsUploadScreen extends RealmsScreen {
private void upload() { private void upload() {
this.uploadStarted = true; this.uploadStarted = true;
File file2; File file2;
final RealmsClient cyv3; final RealmsClient cyy3;
final long long4; final long long4;
UploadInfo uploadInfo6; UploadInfo uploadInfo6;
int integer7; int integer7;
@ -278,11 +278,11 @@ public class RealmsUploadScreen extends RealmsScreen {
Unit a10; Unit a10;
Unit a11; Unit a11;
Unit a12; Unit a12;
FileUpload cyt8; FileUpload cyw8;
final long long6; final long long6;
new Thread(() -> { new Thread(() -> {
file2 = null; file2 = null;
cyv3 = RealmsClient.createRealmsClient(); cyy3 = RealmsClient.createRealmsClient();
long4 = this.worldId; long4 = this.worldId;
try { try {
if (!(!RealmsUploadScreen.uploadLock.tryLock(1L, TimeUnit.SECONDS))) { if (!(!RealmsUploadScreen.uploadLock.tryLock(1L, TimeUnit.SECONDS))) {
@ -296,11 +296,11 @@ public class RealmsUploadScreen extends RealmsScreen {
return; return;
} }
else { else {
uploadInfo6 = cyv3.upload(long4, UploadTokenCache.get(long4)); uploadInfo6 = cyy3.upload(long4, UploadTokenCache.get(long4));
} }
} }
catch (RetryCallException cze8) { catch (RetryCallException czh8) {
Thread.sleep(cze8.delaySeconds * 1000); Thread.sleep(czh8.delaySeconds * 1000);
++integer7; ++integer7;
continue; continue;
} }
@ -337,25 +337,25 @@ public class RealmsUploadScreen extends RealmsScreen {
} }
else { else {
this.status = RealmsScreen.getLocalizedString("mco.upload.uploading", this.selectedLevel.getLevelName()); this.status = RealmsScreen.getLocalizedString("mco.upload.uploading", this.selectedLevel.getLevelName());
cyt8 = new FileUpload(file2, this.worldId, this.slotId, uploadInfo6, Realms.getSessionId(), Realms.getName(), Realms.getMinecraftVersionString(), this.uploadStatus); cyw8 = new FileUpload(file2, this.worldId, this.slotId, uploadInfo6, Realms.getSessionId(), Realms.getName(), Realms.getMinecraftVersionString(), this.uploadStatus);
cyt8.upload(dan -> { cyw8.upload(dap -> {
if (dan.statusCode >= 200 && dan.statusCode < 300) { if (dap.statusCode >= 200 && dap.statusCode < 300) {
this.uploadFinished = true; this.uploadFinished = true;
this.status = RealmsScreen.getLocalizedString("mco.upload.done"); this.status = RealmsScreen.getLocalizedString("mco.upload.done");
this.backButton.setMessage(RealmsScreen.getLocalizedString("gui.done")); this.backButton.setMessage(RealmsScreen.getLocalizedString("gui.done"));
UploadTokenCache.invalidate(long6); UploadTokenCache.invalidate(long6);
} }
else if (dan.statusCode == 400 && dan.errorMessage != null) { else if (dap.statusCode == 400 && dap.errorMessage != null) {
this.errorMessage = RealmsScreen.getLocalizedString("mco.upload.failed", dan.errorMessage); this.errorMessage = RealmsScreen.getLocalizedString("mco.upload.failed", dap.errorMessage);
} }
else { else {
this.errorMessage = RealmsScreen.getLocalizedString("mco.upload.failed", dan.statusCode); this.errorMessage = RealmsScreen.getLocalizedString("mco.upload.failed", dap.statusCode);
} }
return; return;
}); });
while (!cyt8.isFinished()) { while (!cyw8.isFinished()) {
if (this.cancelled) { if (this.cancelled) {
cyt8.cancel(); cyw8.cancel();
this.uploadCancelled(); this.uploadCancelled();
} }
else { else {
@ -375,8 +375,8 @@ public class RealmsUploadScreen extends RealmsScreen {
catch (IOException iOException6) { catch (IOException iOException6) {
this.errorMessage = RealmsScreen.getLocalizedString("mco.upload.failed", iOException6.getMessage()); this.errorMessage = RealmsScreen.getLocalizedString("mco.upload.failed", iOException6.getMessage());
} }
catch (RealmsServiceException czd6) { catch (RealmsServiceException czg6) {
this.errorMessage = RealmsScreen.getLocalizedString("mco.upload.failed", czd6.toString()); this.errorMessage = RealmsScreen.getLocalizedString("mco.upload.failed", czg6.toString());
} }
catch (InterruptedException interruptedException10) { catch (InterruptedException interruptedException10) {
RealmsUploadScreen.LOGGER.error("Could not acquire upload lock"); RealmsUploadScreen.LOGGER.error("Could not acquire upload lock");

View File

@ -3,7 +3,6 @@ package com.mojang.realmsclient.util;
import com.mojang.realmsclient.dto.WorldDownload; import com.mojang.realmsclient.dto.WorldDownload;
import com.mojang.realmsclient.gui.screens.RealmsDownloadLatestWorldScreen; import com.mojang.realmsclient.gui.screens.RealmsDownloadLatestWorldScreen;
import com.mojang.realmsclient.dto.Backup; import com.mojang.realmsclient.dto.Backup;
import com.mojang.realmsclient.gui.screens.RealmsResetWorldScreen;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import net.minecraft.realms.RealmsConnect; import net.minecraft.realms.RealmsConnect;
import com.mojang.realmsclient.dto.RealmsServerAddress; import com.mojang.realmsclient.dto.RealmsServerAddress;
@ -61,13 +60,13 @@ public class RealmsTasks {
@Override @Override
public void run() { public void run() {
this.setTitle(RealmsScreen.getLocalizedString("mco.configure.world.opening")); this.setTitle(RealmsScreen.getLocalizedString("mco.configure.world.opening"));
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
for (int integer3 = 0; integer3 < 25; ++integer3) { for (int integer3 = 0; integer3 < 25; ++integer3) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
try { try {
final boolean boolean4 = cyv2.open(this.serverData.id); final boolean boolean4 = cyy2.open(this.serverData.id);
if (boolean4) { if (boolean4) {
if (this.returnScreen instanceof RealmsConfigureWorldScreen) { if (this.returnScreen instanceof RealmsConfigureWorldScreen) {
((RealmsConfigureWorldScreen)this.returnScreen).stateChanged(); ((RealmsConfigureWorldScreen)this.returnScreen).stateChanged();
@ -81,11 +80,11 @@ public class RealmsTasks {
break; break;
} }
} }
catch (RetryCallException cze4) { catch (RetryCallException czh4) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
pause(cze4.delaySeconds); pause(czh4.delaySeconds);
} }
catch (Exception exception4) { catch (Exception exception4) {
if (this.aborted()) { if (this.aborted()) {
@ -102,21 +101,21 @@ public class RealmsTasks {
private final RealmsServer serverData; private final RealmsServer serverData;
private final RealmsConfigureWorldScreen configureScreen; private final RealmsConfigureWorldScreen configureScreen;
public CloseServerTask(final RealmsServer realmsServer, final RealmsConfigureWorldScreen czp) { public CloseServerTask(final RealmsServer realmsServer, final RealmsConfigureWorldScreen czs) {
this.serverData = realmsServer; this.serverData = realmsServer;
this.configureScreen = czp; this.configureScreen = czs;
} }
@Override @Override
public void run() { public void run() {
this.setTitle(RealmsScreen.getLocalizedString("mco.configure.world.closing")); this.setTitle(RealmsScreen.getLocalizedString("mco.configure.world.closing"));
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
for (int integer3 = 0; integer3 < 25; ++integer3) { for (int integer3 = 0; integer3 < 25; ++integer3) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
try { try {
final boolean boolean4 = cyv2.close(this.serverData.id); final boolean boolean4 = cyy2.close(this.serverData.id);
if (boolean4) { if (boolean4) {
this.configureScreen.stateChanged(); this.configureScreen.stateChanged();
this.serverData.state = RealmsServer.State.CLOSED; this.serverData.state = RealmsServer.State.CLOSED;
@ -124,11 +123,11 @@ public class RealmsTasks {
break; break;
} }
} }
catch (RetryCallException cze4) { catch (RetryCallException czh4) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
pause(cze4.delaySeconds); pause(czh4.delaySeconds);
} }
catch (Exception exception4) { catch (Exception exception4) {
if (this.aborted()) { if (this.aborted()) {
@ -156,7 +155,7 @@ public class RealmsTasks {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
final String string3 = RealmsScreen.getLocalizedString("mco.minigame.world.slot.screen.title"); final String string3 = RealmsScreen.getLocalizedString("mco.minigame.world.slot.screen.title");
this.setTitle(string3); this.setTitle(string3);
for (int integer4 = 0; integer4 < 25; ++integer4) { for (int integer4 = 0; integer4 < 25; ++integer4) {
@ -164,16 +163,16 @@ public class RealmsTasks {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
if (cyv2.switchSlot(this.worldId, this.slot)) { if (cyy2.switchSlot(this.worldId, this.slot)) {
this.listener.confirmResult(true, this.confirmId); this.listener.confirmResult(true, this.confirmId);
break; break;
} }
} }
catch (RetryCallException cze5) { catch (RetryCallException czh5) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
pause(cze5.delaySeconds); pause(czh5.delaySeconds);
} }
catch (Exception exception5) { catch (Exception exception5) {
if (this.aborted()) { if (this.aborted()) {
@ -191,15 +190,15 @@ public class RealmsTasks {
private final WorldTemplate worldTemplate; private final WorldTemplate worldTemplate;
private final RealmsConfigureWorldScreen lastScreen; private final RealmsConfigureWorldScreen lastScreen;
public SwitchMinigameTask(final long long1, final WorldTemplate worldTemplate, final RealmsConfigureWorldScreen czp) { public SwitchMinigameTask(final long long1, final WorldTemplate worldTemplate, final RealmsConfigureWorldScreen czs) {
this.worldId = long1; this.worldId = long1;
this.worldTemplate = worldTemplate; this.worldTemplate = worldTemplate;
this.lastScreen = czp; this.lastScreen = czs;
} }
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
final String string3 = RealmsScreen.getLocalizedString("mco.minigame.world.starting.screen.title"); final String string3 = RealmsScreen.getLocalizedString("mco.minigame.world.starting.screen.title");
this.setTitle(string3); this.setTitle(string3);
for (int integer4 = 0; integer4 < 25; ++integer4) { for (int integer4 = 0; integer4 < 25; ++integer4) {
@ -207,16 +206,16 @@ public class RealmsTasks {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
if (cyv2.putIntoMinigameMode(this.worldId, this.worldTemplate.id)) { if (cyy2.putIntoMinigameMode(this.worldId, this.worldTemplate.id)) {
Realms.setScreen(this.lastScreen); Realms.setScreen(this.lastScreen);
break; break;
} }
} }
catch (RetryCallException cze5) { catch (RetryCallException czh5) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
pause(cze5.delaySeconds); pause(czh5.delaySeconds);
} }
catch (Exception exception5) { catch (Exception exception5) {
if (this.aborted()) { if (this.aborted()) {
@ -271,7 +270,7 @@ public class RealmsTasks {
@Override @Override
public void run() { public void run() {
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
this.setTitle(this.title); this.setTitle(this.title);
for (int integer3 = 0; integer3 < 25; ++integer3) { for (int integer3 = 0; integer3 < 25; ++integer3) {
try { try {
@ -279,10 +278,10 @@ public class RealmsTasks {
return; return;
} }
if (this.worldTemplate != null) { if (this.worldTemplate != null) {
cyv2.resetWorldWithTemplate(this.serverId, this.worldTemplate.id); cyy2.resetWorldWithTemplate(this.serverId, this.worldTemplate.id);
} }
else { else {
cyv2.resetWorldWithSeed(this.serverId, this.seed, this.levelType, this.generateStructures); cyy2.resetWorldWithSeed(this.serverId, this.seed, this.levelType, this.generateStructures);
} }
if (this.aborted()) { if (this.aborted()) {
return; return;
@ -295,11 +294,11 @@ public class RealmsTasks {
} }
return; return;
} }
catch (RetryCallException cze4) { catch (RetryCallException czh4) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
pause(cze4.delaySeconds); pause(czh4.delaySeconds);
} }
catch (Exception exception4) { catch (Exception exception4) {
if (this.aborted()) { if (this.aborted()) {
@ -319,9 +318,9 @@ public class RealmsTasks {
private final RealmsMainScreen mainScreen; private final RealmsMainScreen mainScreen;
private final ReentrantLock connectLock; private final ReentrantLock connectLock;
public RealmsGetServerDetailsTask(final RealmsMainScreen cyr, final RealmsScreen realmsScreen, final RealmsServer realmsServer, final ReentrantLock reentrantLock) { public RealmsGetServerDetailsTask(final RealmsMainScreen cyu, final RealmsScreen realmsScreen, final RealmsServer realmsServer, final ReentrantLock reentrantLock) {
this.lastScreen = realmsScreen; this.lastScreen = realmsScreen;
this.mainScreen = cyr; this.mainScreen = cyu;
this.server = realmsServer; this.server = realmsServer;
this.connectLock = reentrantLock; this.connectLock = reentrantLock;
} }
@ -329,7 +328,7 @@ public class RealmsTasks {
@Override @Override
public void run() { public void run() {
this.setTitle(RealmsScreen.getLocalizedString("mco.connect.connecting")); this.setTitle(RealmsScreen.getLocalizedString("mco.connect.connecting"));
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
boolean boolean3 = false; boolean boolean3 = false;
boolean boolean4 = false; boolean boolean4 = false;
int integer5 = 5; int integer5 = 5;
@ -341,24 +340,24 @@ public class RealmsTasks {
break; break;
} }
try { try {
realmsServerAddress6 = cyv2.join(this.server.id); realmsServerAddress6 = cyy2.join(this.server.id);
boolean3 = true; boolean3 = true;
} }
catch (RetryCallException cze10) { catch (RetryCallException czh10) {
integer5 = cze10.delaySeconds; integer5 = czh10.delaySeconds;
} }
catch (RealmsServiceException czd10) { catch (RealmsServiceException czg10) {
if (czd10.errorCode == 6002) { if (czg10.errorCode == 6002) {
boolean5 = true; boolean5 = true;
break; break;
} }
if (czd10.errorCode == 6006) { if (czg10.errorCode == 6006) {
boolean6 = true; boolean6 = true;
break; break;
} }
boolean4 = true; boolean4 = true;
this.error(czd10.toString()); this.error(czg10.toString());
RealmsTasks.LOGGER.error("Couldn't connect to world", (Throwable)czd10); RealmsTasks.LOGGER.error("Couldn't connect to world", (Throwable)czg10);
break; break;
} }
catch (IOException iOException10) { catch (IOException iOException10) {
@ -380,11 +379,11 @@ public class RealmsTasks {
} }
else if (boolean6) { else if (boolean6) {
if (this.server.ownerUUID.equals(Realms.getUUID())) { if (this.server.ownerUUID.equals(Realms.getUUID())) {
final RealmsBrokenWorldScreen czn9 = new RealmsBrokenWorldScreen(this.lastScreen, this.mainScreen, this.server.id); final RealmsBrokenWorldScreen czq9 = new RealmsBrokenWorldScreen(this.lastScreen, this.mainScreen, this.server.id);
if (this.server.worldType.equals(RealmsServer.WorldType.MINIGAME)) { if (this.server.worldType.equals(RealmsServer.WorldType.MINIGAME)) {
czn9.setTitle(RealmsScreen.getLocalizedString("mco.brokenworld.minigame.title")); czq9.setTitle(RealmsScreen.getLocalizedString("mco.brokenworld.minigame.title"));
} }
Realms.setScreen(czn9); Realms.setScreen(czq9);
} }
else { else {
Realms.setScreen(new RealmsGenericErrorScreen(RealmsScreen.getLocalizedString("mco.brokenworld.nonowner.title"), RealmsScreen.getLocalizedString("mco.brokenworld.nonowner.error"), this.lastScreen)); Realms.setScreen(new RealmsGenericErrorScreen(RealmsScreen.getLocalizedString("mco.brokenworld.nonowner.title"), RealmsScreen.getLocalizedString("mco.brokenworld.nonowner.error"), this.lastScreen));
@ -398,9 +397,9 @@ public class RealmsTasks {
Realms.setScreen(new RealmsLongConfirmationScreen(new RealmsResourcePackScreen(this.lastScreen, realmsServerAddress6, this.connectLock), RealmsLongConfirmationScreen.Type.Info, string9, string10, true, 100)); Realms.setScreen(new RealmsLongConfirmationScreen(new RealmsResourcePackScreen(this.lastScreen, realmsServerAddress6, this.connectLock), RealmsLongConfirmationScreen.Type.Info, string9, string10, true, 100));
} }
else { else {
final RealmsLongRunningMcoTaskScreen czx9 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, new RealmsConnectTask(this.lastScreen, realmsServerAddress6)); final RealmsLongRunningMcoTaskScreen czz9 = new RealmsLongRunningMcoTaskScreen(this.lastScreen, new RealmsConnectTask(this.lastScreen, realmsServerAddress6));
czx9.start(); czz9.start();
Realms.setScreen(czx9); Realms.setScreen(czz9);
} }
} }
else { else {
@ -464,14 +463,14 @@ public class RealmsTasks {
public void run() { public void run() {
final String string2 = RealmsScreen.getLocalizedString("mco.create.world.wait"); final String string2 = RealmsScreen.getLocalizedString("mco.create.world.wait");
this.setTitle(string2); this.setTitle(string2);
final RealmsClient cyv3 = RealmsClient.createRealmsClient(); final RealmsClient cyy3 = RealmsClient.createRealmsClient();
try { try {
cyv3.initializeWorld(this.worldId, this.name, this.motd); cyy3.initializeWorld(this.worldId, this.name, this.motd);
Realms.setScreen(this.lastScreen); Realms.setScreen(this.lastScreen);
} }
catch (RealmsServiceException czd4) { catch (RealmsServiceException czg4) {
RealmsTasks.LOGGER.error("Couldn't create world"); RealmsTasks.LOGGER.error("Couldn't create world");
this.error(czd4.toString()); this.error(czg4.toString());
} }
catch (UnsupportedEncodingException unsupportedEncodingException4) { catch (UnsupportedEncodingException unsupportedEncodingException4) {
RealmsTasks.LOGGER.error("Couldn't create world"); RealmsTasks.LOGGER.error("Couldn't create world");
@ -488,75 +487,27 @@ public class RealmsTasks {
} }
} }
public static class TrialCreationTask extends LongRunningTask {
private final String name;
private final String motd;
private final RealmsMainScreen lastScreen;
public TrialCreationTask(final String string1, final String string2, final RealmsMainScreen cyr) {
this.name = string1;
this.motd = string2;
this.lastScreen = cyr;
}
@Override
public void run() {
final String string2 = RealmsScreen.getLocalizedString("mco.create.world.wait");
this.setTitle(string2);
final RealmsClient cyv3 = RealmsClient.createRealmsClient();
try {
final RealmsServer realmsServer4 = cyv3.createTrial(this.name, this.motd);
if (realmsServer4 != null) {
this.lastScreen.setCreatedTrial(true);
this.lastScreen.closePopup();
final RealmsResetWorldScreen dad5 = new RealmsResetWorldScreen(this.lastScreen, realmsServer4, this.lastScreen.newScreen(), RealmsScreen.getLocalizedString("mco.selectServer.create"), RealmsScreen.getLocalizedString("mco.create.world.subtitle"), 10526880, RealmsScreen.getLocalizedString("mco.create.world.skip"));
dad5.setResetTitle(RealmsScreen.getLocalizedString("mco.create.world.reset.title"));
Realms.setScreen(dad5);
}
else {
this.error(RealmsScreen.getLocalizedString("mco.trial.unavailable"));
}
}
catch (RealmsServiceException czd4) {
RealmsTasks.LOGGER.error("Couldn't create trial");
this.error(czd4.toString());
}
catch (UnsupportedEncodingException unsupportedEncodingException4) {
RealmsTasks.LOGGER.error("Couldn't create trial");
this.error(unsupportedEncodingException4.getLocalizedMessage());
}
catch (IOException iOException4) {
RealmsTasks.LOGGER.error("Could not parse response creating trial");
this.error(iOException4.getLocalizedMessage());
}
catch (Exception exception4) {
RealmsTasks.LOGGER.error("Could not create trial");
this.error(exception4.getLocalizedMessage());
}
}
}
public static class RestoreTask extends LongRunningTask { public static class RestoreTask extends LongRunningTask {
private final Backup backup; private final Backup backup;
private final long worldId; private final long worldId;
private final RealmsConfigureWorldScreen lastScreen; private final RealmsConfigureWorldScreen lastScreen;
public RestoreTask(final Backup backup, final long long2, final RealmsConfigureWorldScreen czp) { public RestoreTask(final Backup backup, final long long2, final RealmsConfigureWorldScreen czs) {
this.backup = backup; this.backup = backup;
this.worldId = long2; this.worldId = long2;
this.lastScreen = czp; this.lastScreen = czs;
} }
@Override @Override
public void run() { public void run() {
this.setTitle(RealmsScreen.getLocalizedString("mco.backup.restoring")); this.setTitle(RealmsScreen.getLocalizedString("mco.backup.restoring"));
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
for (int integer3 = 0; integer3 < 25; ++integer3) { for (int integer3 = 0; integer3 < 25; ++integer3) {
try { try {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
cyv2.restoreWorld(this.worldId, this.backup.backupId); cyy2.restoreWorld(this.worldId, this.backup.backupId);
pause(1); pause(1);
if (this.aborted()) { if (this.aborted()) {
return; return;
@ -564,18 +515,18 @@ public class RealmsTasks {
Realms.setScreen(this.lastScreen.getNewScreen()); Realms.setScreen(this.lastScreen.getNewScreen());
return; return;
} }
catch (RetryCallException cze4) { catch (RetryCallException czh4) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
pause(cze4.delaySeconds); pause(czh4.delaySeconds);
} }
catch (RealmsServiceException czd4) { catch (RealmsServiceException czg4) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
RealmsTasks.LOGGER.error("Couldn't restore backup", (Throwable)czd4); RealmsTasks.LOGGER.error("Couldn't restore backup", (Throwable)czg4);
Realms.setScreen(new RealmsGenericErrorScreen(czd4, this.lastScreen)); Realms.setScreen(new RealmsGenericErrorScreen(czg4, this.lastScreen));
return; return;
} }
catch (Exception exception4) { catch (Exception exception4) {
@ -606,13 +557,13 @@ public class RealmsTasks {
@Override @Override
public void run() { public void run() {
this.setTitle(RealmsScreen.getLocalizedString("mco.download.preparing")); this.setTitle(RealmsScreen.getLocalizedString("mco.download.preparing"));
final RealmsClient cyv2 = RealmsClient.createRealmsClient(); final RealmsClient cyy2 = RealmsClient.createRealmsClient();
for (int integer3 = 0; integer3 < 25; ++integer3) { for (int integer3 = 0; integer3 < 25; ++integer3) {
try { try {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
final WorldDownload worldDownload4 = cyv2.download(this.worldId, this.slot); final WorldDownload worldDownload4 = cyy2.download(this.worldId, this.slot);
pause(1); pause(1);
if (this.aborted()) { if (this.aborted()) {
return; return;
@ -620,18 +571,18 @@ public class RealmsTasks {
Realms.setScreen(new RealmsDownloadLatestWorldScreen(this.lastScreen, worldDownload4, this.downloadName)); Realms.setScreen(new RealmsDownloadLatestWorldScreen(this.lastScreen, worldDownload4, this.downloadName));
return; return;
} }
catch (RetryCallException cze4) { catch (RetryCallException czh4) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
pause(cze4.delaySeconds); pause(czh4.delaySeconds);
} }
catch (RealmsServiceException czd4) { catch (RealmsServiceException czg4) {
if (this.aborted()) { if (this.aborted()) {
return; return;
} }
RealmsTasks.LOGGER.error("Couldn't download world data"); RealmsTasks.LOGGER.error("Couldn't download world data");
Realms.setScreen(new RealmsGenericErrorScreen(czd4, this.lastScreen)); Realms.setScreen(new RealmsGenericErrorScreen(czg4, this.lastScreen));
return; return;
} }
catch (Exception exception4) { catch (Exception exception4) {

View File

@ -9,10 +9,9 @@ import java.io.IOException;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import org.apache.commons.codec.binary.Base64;
import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.platform.GlStateManager;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import javax.xml.bind.DatatypeConverter; import org.apache.commons.codec.binary.Base64;
import java.io.OutputStream; import java.io.OutputStream;
import java.awt.image.RenderedImage; import java.awt.image.RenderedImage;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -112,7 +111,7 @@ public class RealmsTextureManager {
bufferedImage6 = new SkinProcessor().process(bufferedImage6); bufferedImage6 = new SkinProcessor().process(bufferedImage6);
final ByteArrayOutputStream byteArrayOutputStream7 = new ByteArrayOutputStream(); final ByteArrayOutputStream byteArrayOutputStream7 = new ByteArrayOutputStream();
ImageIO.write(bufferedImage6, "png", byteArrayOutputStream7); ImageIO.write(bufferedImage6, "png", byteArrayOutputStream7);
RealmsTextureManager.fetchedSkins.put(string, DatatypeConverter.printBase64Binary(byteArrayOutputStream7.toByteArray())); RealmsTextureManager.fetchedSkins.put(string, new Base64().encodeToString(byteArrayOutputStream7.toByteArray()));
RealmsTextureManager.skinFetchStatus.put(string, true); RealmsTextureManager.skinFetchStatus.put(string, true);
} }
catch (Exception exception6) { catch (Exception exception6) {

View File

@ -243,6 +243,10 @@ public class CrashReport {
return h3; return h3;
} }
public static void preload() {
new CrashReport("Don't panic!", new Throwable()).getFriendlyReport();
}
static { static {
LOGGER = LogManager.getLogger(); LOGGER = LogManager.getLogger();
} }

View File

@ -147,9 +147,9 @@ public class CrashReportCategory {
return this.stackTrace; return this.stackTrace;
} }
public static void populateBlockDetails(final CrashReportCategory i, final BlockPos fk, @Nullable final BlockState byg) { public static void populateBlockDetails(final CrashReportCategory i, final BlockPos fk, @Nullable final BlockState byj) {
if (byg != null) { if (byj != null) {
i.setDetail("Block", byg::toString); i.setDetail("Block", byj::toString);
} }
i.setDetail("Block location", () -> formatLocation(fk)); i.setDetail("Block location", () -> formatLocation(fk));
} }

View File

@ -27,13 +27,13 @@ public class DetectedVersion implements GameVersion {
public DetectedVersion() { public DetectedVersion() {
this.id = UUID.randomUUID().toString().replaceAll("-", ""); this.id = UUID.randomUUID().toString().replaceAll("-", "");
this.name = "1.15.1"; this.name = "1.15.2";
this.stable = true; this.stable = true;
this.worldVersion = 2227; this.worldVersion = 2230;
this.protocolVersion = 575; this.protocolVersion = 578;
this.packVersion = 5; this.packVersion = 5;
this.buildTime = new Date(); this.buildTime = new Date();
this.releaseTarget = "1.15.1"; this.releaseTarget = "1.15.2";
} }
protected DetectedVersion(final JsonObject jsonObject) { protected DetectedVersion(final JsonObject jsonObject) {

View File

@ -58,8 +58,8 @@ public class Util {
return Collectors.<Map.Entry<? extends K, ? extends V>, K, V>toMap(Map.Entry::getKey, Map.Entry::getValue); return Collectors.<Map.Entry<? extends K, ? extends V>, K, V>toMap(Map.Entry::getKey, Map.Entry::getValue);
} }
public static <T extends Comparable<T>> String getPropertyName(final Property<T> bzj, final Object object) { public static <T extends Comparable<T>> String getPropertyName(final Property<T> bzm, final Object object) {
return bzj.getName((T)object); return bzm.getName((T)object);
} }
public static String makeDescriptionId(final String string, @Nullable final ResourceLocation sm) { public static String makeDescriptionId(final String string, @Nullable final ResourceLocation sm) {

View File

@ -169,12 +169,12 @@ public class Advancement {
return this; return this;
} }
public Builder display(final ItemStack bek, final Component lf2, final Component lf3, @Nullable final ResourceLocation sm, final FrameType ae, final boolean boolean6, final boolean boolean7, final boolean boolean8) { public Builder display(final ItemStack ben, final Component lf2, final Component lf3, @Nullable final ResourceLocation sm, final FrameType ae, final boolean boolean6, final boolean boolean7, final boolean boolean8) {
return this.display(new DisplayInfo(bek, lf2, lf3, sm, ae, boolean6, boolean7, boolean8)); return this.display(new DisplayInfo(ben, lf2, lf3, sm, ae, boolean6, boolean7, boolean8));
} }
public Builder display(final ItemLike bjs, final Component lf2, final Component lf3, @Nullable final ResourceLocation sm, final FrameType ae, final boolean boolean6, final boolean boolean7, final boolean boolean8) { public Builder display(final ItemLike bjv, final Component lf2, final Component lf3, @Nullable final ResourceLocation sm, final FrameType ae, final boolean boolean6, final boolean boolean7, final boolean boolean8) {
return this.display(new DisplayInfo(new ItemStack(bjs.asItem()), lf2, lf3, sm, ae, boolean6, boolean7, boolean8)); return this.display(new DisplayInfo(new ItemStack(bjv.asItem()), lf2, lf3, sm, ae, boolean6, boolean7, boolean8));
} }
public Builder display(final DisplayInfo ad) { public Builder display(final DisplayInfo ad) {

View File

@ -45,21 +45,21 @@ public class AdvancementRewards {
public void grant(final ServerPlayer xe) { public void grant(final ServerPlayer xe) {
xe.giveExperiencePoints(this.experience); xe.giveExperiencePoints(this.experience);
final LootContext cru3 = new LootContext.Builder(xe.getLevel()).<Entity>withParameter(LootContextParams.THIS_ENTITY, xe).<BlockPos>withParameter(LootContextParams.BLOCK_POS, new BlockPos(xe)).withRandom(xe.getRandom()).create(LootContextParamSets.ADVANCEMENT_REWARD); final LootContext crx3 = new LootContext.Builder(xe.getLevel()).<Entity>withParameter(LootContextParams.THIS_ENTITY, xe).<BlockPos>withParameter(LootContextParams.BLOCK_POS, new BlockPos(xe)).withRandom(xe.getRandom()).create(LootContextParamSets.ADVANCEMENT_REWARD);
boolean boolean4 = false; boolean boolean4 = false;
for (final ResourceLocation sm8 : this.loot) { for (final ResourceLocation sm8 : this.loot) {
for (final ItemStack bek10 : xe.server.getLootTables().get(sm8).getRandomItems(cru3)) { for (final ItemStack ben10 : xe.server.getLootTables().get(sm8).getRandomItems(crx3)) {
if (xe.addItem(bek10)) { if (xe.addItem(ben10)) {
xe.level.playSound(null, xe.getX(), xe.getY(), xe.getZ(), SoundEvents.ITEM_PICKUP, SoundSource.PLAYERS, 0.2f, ((xe.getRandom().nextFloat() - xe.getRandom().nextFloat()) * 0.7f + 1.0f) * 2.0f); xe.level.playSound(null, xe.getX(), xe.getY(), xe.getZ(), SoundEvents.ITEM_PICKUP, SoundSource.PLAYERS, 0.2f, ((xe.getRandom().nextFloat() - xe.getRandom().nextFloat()) * 0.7f + 1.0f) * 2.0f);
boolean4 = true; boolean4 = true;
} }
else { else {
final ItemEntity avy11 = xe.drop(bek10, false); final ItemEntity awb11 = xe.drop(ben10, false);
if (avy11 == null) { if (awb11 == null) {
continue; continue;
} }
avy11.setNoPickUpDelay(); awb11.setNoPickUpDelay();
avy11.setOwner(xe.getUUID()); awb11.setOwner(xe.getUUID());
} }
} }
} }

View File

@ -30,10 +30,10 @@ public class DisplayInfo {
private float x; private float x;
private float y; private float y;
public DisplayInfo(final ItemStack bek, final Component lf2, final Component lf3, @Nullable final ResourceLocation sm, final FrameType ae, final boolean boolean6, final boolean boolean7, final boolean boolean8) { public DisplayInfo(final ItemStack ben, final Component lf2, final Component lf3, @Nullable final ResourceLocation sm, final FrameType ae, final boolean boolean6, final boolean boolean7, final boolean boolean8) {
this.title = lf2; this.title = lf2;
this.description = lf3; this.description = lf3;
this.icon = bek; this.icon = ben;
this.background = sm; this.background = sm;
this.frame = ae; this.frame = ae;
this.showToast = boolean6; this.showToast = boolean6;
@ -93,34 +93,34 @@ public class DisplayInfo {
if (lf3 == null || lf4 == null) { if (lf3 == null || lf4 == null) {
throw new JsonSyntaxException("Both title and description must be set"); throw new JsonSyntaxException("Both title and description must be set");
} }
final ItemStack bek5 = getIcon(GsonHelper.getAsJsonObject(jsonObject, "icon")); final ItemStack ben5 = getIcon(GsonHelper.getAsJsonObject(jsonObject, "icon"));
final ResourceLocation sm6 = jsonObject.has("background") ? new ResourceLocation(GsonHelper.getAsString(jsonObject, "background")) : null; final ResourceLocation sm6 = jsonObject.has("background") ? new ResourceLocation(GsonHelper.getAsString(jsonObject, "background")) : null;
final FrameType ae7 = jsonObject.has("frame") ? FrameType.byName(GsonHelper.getAsString(jsonObject, "frame")) : FrameType.TASK; final FrameType ae7 = jsonObject.has("frame") ? FrameType.byName(GsonHelper.getAsString(jsonObject, "frame")) : FrameType.TASK;
final boolean boolean8 = GsonHelper.getAsBoolean(jsonObject, "show_toast", true); final boolean boolean8 = GsonHelper.getAsBoolean(jsonObject, "show_toast", true);
final boolean boolean9 = GsonHelper.getAsBoolean(jsonObject, "announce_to_chat", true); final boolean boolean9 = GsonHelper.getAsBoolean(jsonObject, "announce_to_chat", true);
final boolean boolean10 = GsonHelper.getAsBoolean(jsonObject, "hidden", false); final boolean boolean10 = GsonHelper.getAsBoolean(jsonObject, "hidden", false);
return new DisplayInfo(bek5, lf3, lf4, sm6, ae7, boolean8, boolean9, boolean10); return new DisplayInfo(ben5, lf3, lf4, sm6, ae7, boolean8, boolean9, boolean10);
} }
private static ItemStack getIcon(final JsonObject jsonObject) { private static ItemStack getIcon(final JsonObject jsonObject) {
if (!jsonObject.has("item")) { if (!jsonObject.has("item")) {
throw new JsonSyntaxException("Unsupported icon type, currently only items are supported (add 'item' key)"); throw new JsonSyntaxException("Unsupported icon type, currently only items are supported (add 'item' key)");
} }
final Item bef2 = GsonHelper.getAsItem(jsonObject, "item"); final Item bei2 = GsonHelper.getAsItem(jsonObject, "item");
if (jsonObject.has("data")) { if (jsonObject.has("data")) {
throw new JsonParseException("Disallowed data tag found"); throw new JsonParseException("Disallowed data tag found");
} }
final ItemStack bek3 = new ItemStack(bef2); final ItemStack ben3 = new ItemStack(bei2);
if (jsonObject.has("nbt")) { if (jsonObject.has("nbt")) {
try { try {
final CompoundTag jt4 = TagParser.parseTag(GsonHelper.convertToString(jsonObject.get("nbt"), "nbt")); final CompoundTag jt4 = TagParser.parseTag(GsonHelper.convertToString(jsonObject.get("nbt"), "nbt"));
bek3.setTag(jt4); ben3.setTag(jt4);
} }
catch (CommandSyntaxException commandSyntaxException4) { catch (CommandSyntaxException commandSyntaxException4) {
throw new JsonSyntaxException("Invalid nbt tag: " + commandSyntaxException4.getMessage()); throw new JsonSyntaxException("Invalid nbt tag: " + commandSyntaxException4.getMessage());
} }
} }
return bek3; return ben3;
} }
public void serializeToNetwork(final FriendlyByteBuf kv) { public void serializeToNetwork(final FriendlyByteBuf kv) {
@ -149,13 +149,13 @@ public class DisplayInfo {
public static DisplayInfo fromNetwork(final FriendlyByteBuf kv) { public static DisplayInfo fromNetwork(final FriendlyByteBuf kv) {
final Component lf2 = kv.readComponent(); final Component lf2 = kv.readComponent();
final Component lf3 = kv.readComponent(); final Component lf3 = kv.readComponent();
final ItemStack bek4 = kv.readItem(); final ItemStack ben4 = kv.readItem();
final FrameType ae5 = kv.<FrameType>readEnum(FrameType.class); final FrameType ae5 = kv.<FrameType>readEnum(FrameType.class);
final int integer6 = kv.readInt(); final int integer6 = kv.readInt();
final ResourceLocation sm7 = ((integer6 & 0x1) != 0x0) ? kv.readResourceLocation() : null; final ResourceLocation sm7 = ((integer6 & 0x1) != 0x0) ? kv.readResourceLocation() : null;
final boolean boolean8 = (integer6 & 0x2) != 0x0; final boolean boolean8 = (integer6 & 0x2) != 0x0;
final boolean boolean9 = (integer6 & 0x4) != 0x0; final boolean boolean9 = (integer6 & 0x4) != 0x0;
final DisplayInfo ad10 = new DisplayInfo(bek4, lf2, lf3, sm7, ae5, boolean8, false, boolean9); final DisplayInfo ad10 = new DisplayInfo(ben4, lf2, lf3, sm7, ae5, boolean8, false, boolean9);
ad10.setLocation(kv.readFloat(), kv.readFloat()); ad10.setLocation(kv.readFloat(), kv.readFloat());
return ad10; return ad10;
} }

View File

@ -23,10 +23,10 @@ public class BeeNestDestroyedTrigger extends SimpleCriterionTrigger<TriggerInsta
@Override @Override
public TriggerInstance createInstance(final JsonObject jsonObject, final JsonDeserializationContext jsonDeserializationContext) { public TriggerInstance createInstance(final JsonObject jsonObject, final JsonDeserializationContext jsonDeserializationContext) {
final Block bpe4 = deserializeBlock(jsonObject); final Block bph4 = deserializeBlock(jsonObject);
final ItemPredicate bj5 = ItemPredicate.fromJson(jsonObject.get("item")); final ItemPredicate bj5 = ItemPredicate.fromJson(jsonObject.get("item"));
final MinMaxBounds.Ints d6 = MinMaxBounds.Ints.fromJson(jsonObject.get("num_bees_inside")); final MinMaxBounds.Ints d6 = MinMaxBounds.Ints.fromJson(jsonObject.get("num_bees_inside"));
return new TriggerInstance(bpe4, bj5, d6); return new TriggerInstance(bph4, bj5, d6);
} }
@Nullable @Nullable
@ -43,8 +43,8 @@ public class BeeNestDestroyedTrigger extends SimpleCriterionTrigger<TriggerInsta
return null; return null;
} }
public void trigger(final ServerPlayer xe, final Block bpe, final ItemStack bek, final int integer) { public void trigger(final ServerPlayer xe, final Block bph, final ItemStack ben, final int integer) {
this.trigger(xe.getAdvancements(), a -> a.matches(bpe, bek, integer)); this.trigger(xe.getAdvancements(), a -> a.matches(bph, ben, integer));
} }
static { static {
@ -56,19 +56,19 @@ public class BeeNestDestroyedTrigger extends SimpleCriterionTrigger<TriggerInsta
private final ItemPredicate item; private final ItemPredicate item;
private final MinMaxBounds.Ints numBees; private final MinMaxBounds.Ints numBees;
public TriggerInstance(final Block bpe, final ItemPredicate bj, final MinMaxBounds.Ints d) { public TriggerInstance(final Block bph, final ItemPredicate bj, final MinMaxBounds.Ints d) {
super(BeeNestDestroyedTrigger.ID); super(BeeNestDestroyedTrigger.ID);
this.block = bpe; this.block = bph;
this.item = bj; this.item = bj;
this.numBees = d; this.numBees = d;
} }
public static TriggerInstance destroyedBeeNest(final Block bpe, final ItemPredicate.Builder a, final MinMaxBounds.Ints d) { public static TriggerInstance destroyedBeeNest(final Block bph, final ItemPredicate.Builder a, final MinMaxBounds.Ints d) {
return new TriggerInstance(bpe, a.build(), d); return new TriggerInstance(bph, a.build(), d);
} }
public boolean matches(final Block bpe, final ItemStack bek, final int integer) { public boolean matches(final Block bph, final ItemStack ben, final int integer) {
return (this.block == null || bpe == this.block) && this.item.matches(bek) && this.numBees.matches(integer); return (this.block == null || bph == this.block) && this.item.matches(ben) && this.numBees.matches(integer);
} }
@Override @Override

View File

@ -26,9 +26,9 @@ public class BlockPredicate {
private final StatePropertiesPredicate properties; private final StatePropertiesPredicate properties;
private final NbtPredicate nbt; private final NbtPredicate nbt;
public BlockPredicate(@Nullable final Tag<Block> aaz, @Nullable final Block bpe, final StatePropertiesPredicate cc, final NbtPredicate bt) { public BlockPredicate(@Nullable final Tag<Block> aaz, @Nullable final Block bph, final StatePropertiesPredicate cc, final NbtPredicate bt) {
this.tag = aaz; this.tag = aaz;
this.block = bpe; this.block = bph;
this.properties = cc; this.properties = cc;
this.nbt = bt; this.nbt = bt;
} }
@ -40,20 +40,20 @@ public class BlockPredicate {
if (!xd.isLoaded(fk)) { if (!xd.isLoaded(fk)) {
return false; return false;
} }
final BlockState byg4 = xd.getBlockState(fk); final BlockState byj4 = xd.getBlockState(fk);
final Block bpe5 = byg4.getBlock(); final Block bph5 = byj4.getBlock();
if (this.tag != null && !this.tag.contains(bpe5)) { if (this.tag != null && !this.tag.contains(bph5)) {
return false; return false;
} }
if (this.block != null && bpe5 != this.block) { if (this.block != null && bph5 != this.block) {
return false; return false;
} }
if (!this.properties.matches(byg4)) { if (!this.properties.matches(byj4)) {
return false; return false;
} }
if (this.nbt != NbtPredicate.ANY) { if (this.nbt != NbtPredicate.ANY) {
final BlockEntity bwi6 = xd.getBlockEntity(fk); final BlockEntity bwl6 = xd.getBlockEntity(fk);
if (bwi6 == null || !this.nbt.matches(bwi6.save(new CompoundTag()))) { if (bwl6 == null || !this.nbt.matches(bwl6.save(new CompoundTag()))) {
return false; return false;
} }
} }
@ -66,10 +66,10 @@ public class BlockPredicate {
} }
final JsonObject jsonObject2 = GsonHelper.convertToJsonObject(jsonElement, "block"); final JsonObject jsonObject2 = GsonHelper.convertToJsonObject(jsonElement, "block");
final NbtPredicate bt3 = NbtPredicate.fromJson(jsonObject2.get("nbt")); final NbtPredicate bt3 = NbtPredicate.fromJson(jsonObject2.get("nbt"));
Block bpe4 = null; Block bph4 = null;
if (jsonObject2.has("block")) { if (jsonObject2.has("block")) {
final ResourceLocation sm5 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "block")); final ResourceLocation sm5 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "block"));
bpe4 = Registry.BLOCK.get(sm5); bph4 = Registry.BLOCK.get(sm5);
} }
Tag<Block> aaz5 = null; Tag<Block> aaz5 = null;
if (jsonObject2.has("tag")) { if (jsonObject2.has("tag")) {
@ -80,7 +80,7 @@ public class BlockPredicate {
} }
} }
final StatePropertiesPredicate cc6 = StatePropertiesPredicate.fromJson(jsonObject2.get("state")); final StatePropertiesPredicate cc6 = StatePropertiesPredicate.fromJson(jsonObject2.get("state"));
return new BlockPredicate(aaz5, bpe4, cc6, bt3); return new BlockPredicate(aaz5, bph4, cc6, bt3);
} }
public JsonElement serializeToJson() { public JsonElement serializeToJson() {

View File

@ -27,8 +27,8 @@ public class BredAnimalsTrigger extends SimpleCriterionTrigger<TriggerInstance>
return new TriggerInstance(bb4, bb5, bb6); return new TriggerInstance(bb4, bb5, bb6);
} }
public void trigger(final ServerPlayer xe, final Animal asz2, @Nullable final Animal asz3, @Nullable final AgableMob akl) { public void trigger(final ServerPlayer xe, final Animal atc2, @Nullable final Animal atc3, @Nullable final AgableMob ako) {
this.trigger(xe.getAdvancements(), a -> a.matches(xe, asz2, asz3, akl)); this.trigger(xe.getAdvancements(), a -> a.matches(xe, atc2, atc3, ako));
} }
static { static {
@ -55,8 +55,8 @@ public class BredAnimalsTrigger extends SimpleCriterionTrigger<TriggerInstance>
return new TriggerInstance(a.build(), EntityPredicate.ANY, EntityPredicate.ANY); return new TriggerInstance(a.build(), EntityPredicate.ANY, EntityPredicate.ANY);
} }
public boolean matches(final ServerPlayer xe, final Animal asz2, @Nullable final Animal asz3, @Nullable final AgableMob akl) { public boolean matches(final ServerPlayer xe, final Animal atc2, @Nullable final Animal atc3, @Nullable final AgableMob ako) {
return this.child.matches(xe, akl) && ((this.parent.matches(xe, asz2) && this.partner.matches(xe, asz3)) || (this.parent.matches(xe, asz3) && this.partner.matches(xe, asz2))); return this.child.matches(xe, ako) && ((this.parent.matches(xe, atc2) && this.partner.matches(xe, atc3)) || (this.parent.matches(xe, atc3) && this.partner.matches(xe, atc2)));
} }
@Override @Override

View File

@ -22,21 +22,21 @@ public class BrewedPotionTrigger extends SimpleCriterionTrigger<TriggerInstance>
@Override @Override
public TriggerInstance createInstance(final JsonObject jsonObject, final JsonDeserializationContext jsonDeserializationContext) { public TriggerInstance createInstance(final JsonObject jsonObject, final JsonDeserializationContext jsonDeserializationContext) {
Potion bga4 = null; Potion bgd4 = null;
if (jsonObject.has("potion")) { if (jsonObject.has("potion")) {
final ResourceLocation sm5 = new ResourceLocation(GsonHelper.getAsString(jsonObject, "potion")); final ResourceLocation sm5 = new ResourceLocation(GsonHelper.getAsString(jsonObject, "potion"));
final Object o; final Object o;
final Object obj; final Object obj;
bga4 = Registry.POTION.getOptional(sm5).<Throwable>orElseThrow(() -> { bgd4 = Registry.POTION.getOptional(sm5).<Throwable>orElseThrow(() -> {
new JsonSyntaxException("Unknown potion '" + obj + "'"); new JsonSyntaxException("Unknown potion '" + obj + "'");
return o; return o;
}); });
} }
return new TriggerInstance(bga4); return new TriggerInstance(bgd4);
} }
public void trigger(final ServerPlayer xe, final Potion bga) { public void trigger(final ServerPlayer xe, final Potion bgd) {
this.trigger(xe.getAdvancements(), a -> a.matches(bga)); this.trigger(xe.getAdvancements(), a -> a.matches(bgd));
} }
static { static {
@ -46,17 +46,17 @@ public class BrewedPotionTrigger extends SimpleCriterionTrigger<TriggerInstance>
public static class TriggerInstance extends AbstractCriterionTriggerInstance { public static class TriggerInstance extends AbstractCriterionTriggerInstance {
private final Potion potion; private final Potion potion;
public TriggerInstance(@Nullable final Potion bga) { public TriggerInstance(@Nullable final Potion bgd) {
super(BrewedPotionTrigger.ID); super(BrewedPotionTrigger.ID);
this.potion = bga; this.potion = bgd;
} }
public static TriggerInstance brewedPotion() { public static TriggerInstance brewedPotion() {
return new TriggerInstance((Potion)null); return new TriggerInstance((Potion)null);
} }
public boolean matches(final Potion bga) { public boolean matches(final Potion bgd) {
return this.potion == null || this.potion == bga; return this.potion == null || this.potion == bgd;
} }
@Override @Override

View File

@ -20,13 +20,13 @@ public class ChangeDimensionTrigger extends SimpleCriterionTrigger<TriggerInstan
@Override @Override
public TriggerInstance createInstance(final JsonObject jsonObject, final JsonDeserializationContext jsonDeserializationContext) { public TriggerInstance createInstance(final JsonObject jsonObject, final JsonDeserializationContext jsonDeserializationContext) {
final DimensionType cbf4 = jsonObject.has("from") ? DimensionType.getByName(new ResourceLocation(GsonHelper.getAsString(jsonObject, "from"))) : null; final DimensionType cbi4 = jsonObject.has("from") ? DimensionType.getByName(new ResourceLocation(GsonHelper.getAsString(jsonObject, "from"))) : null;
final DimensionType cbf5 = jsonObject.has("to") ? DimensionType.getByName(new ResourceLocation(GsonHelper.getAsString(jsonObject, "to"))) : null; final DimensionType cbi5 = jsonObject.has("to") ? DimensionType.getByName(new ResourceLocation(GsonHelper.getAsString(jsonObject, "to"))) : null;
return new TriggerInstance(cbf4, cbf5); return new TriggerInstance(cbi4, cbi5);
} }
public void trigger(final ServerPlayer xe, final DimensionType cbf2, final DimensionType cbf3) { public void trigger(final ServerPlayer xe, final DimensionType cbi2, final DimensionType cbi3) {
this.trigger(xe.getAdvancements(), a -> a.matches(cbf2, cbf3)); this.trigger(xe.getAdvancements(), a -> a.matches(cbi2, cbi3));
} }
static { static {
@ -39,18 +39,18 @@ public class ChangeDimensionTrigger extends SimpleCriterionTrigger<TriggerInstan
@Nullable @Nullable
private final DimensionType to; private final DimensionType to;
public TriggerInstance(@Nullable final DimensionType cbf1, @Nullable final DimensionType cbf2) { public TriggerInstance(@Nullable final DimensionType cbi1, @Nullable final DimensionType cbi2) {
super(ChangeDimensionTrigger.ID); super(ChangeDimensionTrigger.ID);
this.from = cbf1; this.from = cbi1;
this.to = cbf2; this.to = cbi2;
} }
public static TriggerInstance changedDimensionTo(final DimensionType cbf) { public static TriggerInstance changedDimensionTo(final DimensionType cbi) {
return new TriggerInstance(null, cbf); return new TriggerInstance(null, cbi);
} }
public boolean matches(final DimensionType cbf1, final DimensionType cbf2) { public boolean matches(final DimensionType cbi1, final DimensionType cbi2) {
return (this.from == null || this.from == cbf1) && (this.to == null || this.to == cbf2); return (this.from == null || this.from == cbi1) && (this.to == null || this.to == cbi2);
} }
@Override @Override

View File

@ -47,8 +47,8 @@ public class ChanneledLightningTrigger extends SimpleCriterionTrigger<TriggerIns
public boolean matches(final ServerPlayer xe, final Collection<? extends Entity> collection) { public boolean matches(final ServerPlayer xe, final Collection<? extends Entity> collection) {
for (final EntityPredicate bb7 : this.victims) { for (final EntityPredicate bb7 : this.victims) {
boolean boolean8 = false; boolean boolean8 = false;
for (final Entity akn10 : collection) { for (final Entity akq10 : collection) {
if (bb7.matches(xe, akn10)) { if (bb7.matches(xe, akq10)) {
boolean8 = true; boolean8 = true;
break; break;
} }

View File

@ -22,8 +22,8 @@ public class ConstructBeaconTrigger extends SimpleCriterionTrigger<TriggerInstan
return new TriggerInstance(d4); return new TriggerInstance(d4);
} }
public void trigger(final ServerPlayer xe, final BeaconBlockEntity bwd) { public void trigger(final ServerPlayer xe, final BeaconBlockEntity bwg) {
this.trigger(xe.getAdvancements(), a -> a.matches(bwd)); this.trigger(xe.getAdvancements(), a -> a.matches(bwg));
} }
static { static {
@ -42,8 +42,8 @@ public class ConstructBeaconTrigger extends SimpleCriterionTrigger<TriggerInstan
return new TriggerInstance(d); return new TriggerInstance(d);
} }
public boolean matches(final BeaconBlockEntity bwd) { public boolean matches(final BeaconBlockEntity bwg) {
return this.level.matches(bwd.getLevels()); return this.level.matches(bwg.getLevels());
} }
@Override @Override

View File

@ -25,8 +25,8 @@ public class ConsumeItemTrigger extends SimpleCriterionTrigger<TriggerInstance>
return new TriggerInstance(ItemPredicate.fromJson(jsonObject.get("item"))); return new TriggerInstance(ItemPredicate.fromJson(jsonObject.get("item")));
} }
public void trigger(final ServerPlayer xe, final ItemStack bek) { public void trigger(final ServerPlayer xe, final ItemStack ben) {
this.trigger(xe.getAdvancements(), a -> a.matches(bek)); this.trigger(xe.getAdvancements(), a -> a.matches(ben));
} }
static { static {
@ -45,12 +45,12 @@ public class ConsumeItemTrigger extends SimpleCriterionTrigger<TriggerInstance>
return new TriggerInstance(ItemPredicate.ANY); return new TriggerInstance(ItemPredicate.ANY);
} }
public static TriggerInstance usedItem(final ItemLike bjs) { public static TriggerInstance usedItem(final ItemLike bjv) {
return new TriggerInstance(new ItemPredicate(null, bjs.asItem(), MinMaxBounds.Ints.ANY, MinMaxBounds.Ints.ANY, EnchantmentPredicate.NONE, EnchantmentPredicate.NONE, null, NbtPredicate.ANY)); return new TriggerInstance(new ItemPredicate(null, bjv.asItem(), MinMaxBounds.Ints.ANY, MinMaxBounds.Ints.ANY, EnchantmentPredicate.NONE, EnchantmentPredicate.NONE, null, NbtPredicate.ANY));
} }
public boolean matches(final ItemStack bek) { public boolean matches(final ItemStack ben) {
return this.item.matches(bek); return this.item.matches(ben);
} }
@Override @Override

View File

@ -25,8 +25,8 @@ public class CuredZombieVillagerTrigger extends SimpleCriterionTrigger<TriggerIn
return new TriggerInstance(bb4, bb5); return new TriggerInstance(bb4, bb5);
} }
public void trigger(final ServerPlayer xe, final Zombie axm, final Villager axt) { public void trigger(final ServerPlayer xe, final Zombie axp, final Villager axw) {
this.trigger(xe.getAdvancements(), a -> a.matches(xe, axm, axt)); this.trigger(xe.getAdvancements(), a -> a.matches(xe, axp, axw));
} }
static { static {
@ -47,8 +47,8 @@ public class CuredZombieVillagerTrigger extends SimpleCriterionTrigger<TriggerIn
return new TriggerInstance(EntityPredicate.ANY, EntityPredicate.ANY); return new TriggerInstance(EntityPredicate.ANY, EntityPredicate.ANY);
} }
public boolean matches(final ServerPlayer xe, final Zombie axm, final Villager axt) { public boolean matches(final ServerPlayer xe, final Zombie axp, final Villager axw) {
return this.zombie.matches(xe, axm) && this.villager.matches(xe, axt); return this.zombie.matches(xe, axp) && this.villager.matches(xe, axw);
} }
@Override @Override

View File

@ -32,8 +32,8 @@ public class DamagePredicate {
this.type = as; this.type = as;
} }
public boolean matches(final ServerPlayer xe, final DamageSource ajw, final float float3, final float float4, final boolean boolean5) { public boolean matches(final ServerPlayer xe, final DamageSource ajz, final float float3, final float float4, final boolean boolean5) {
return this == DamagePredicate.ANY || (this.dealtDamage.matches(float3) && this.takenDamage.matches(float4) && this.sourceEntity.matches(xe, ajw.getEntity()) && (this.blocked == null || this.blocked == boolean5) && this.type.matches(xe, ajw)); return this == DamagePredicate.ANY || (this.dealtDamage.matches(float3) && this.takenDamage.matches(float4) && this.sourceEntity.matches(xe, ajz.getEntity()) && (this.blocked == null || this.blocked == boolean5) && this.type.matches(xe, ajz));
} }
public static DamagePredicate fromJson(@Nullable final JsonElement jsonElement) { public static DamagePredicate fromJson(@Nullable final JsonElement jsonElement) {

View File

@ -36,12 +36,12 @@ public class DamageSourcePredicate {
this.sourceEntity = bb10; this.sourceEntity = bb10;
} }
public boolean matches(final ServerPlayer xe, final DamageSource ajw) { public boolean matches(final ServerPlayer xe, final DamageSource ajz) {
return this.matches(xe.getLevel(), xe.position(), ajw); return this.matches(xe.getLevel(), xe.position(), ajz);
} }
public boolean matches(final ServerLevel xd, final Vec3 cvi, final DamageSource ajw) { public boolean matches(final ServerLevel xd, final Vec3 cvl, final DamageSource ajz) {
return this == DamageSourcePredicate.ANY || ((this.isProjectile == null || this.isProjectile == ajw.isProjectile()) && (this.isExplosion == null || this.isExplosion == ajw.isExplosion()) && (this.bypassesArmor == null || this.bypassesArmor == ajw.isBypassArmor()) && (this.bypassesInvulnerability == null || this.bypassesInvulnerability == ajw.isBypassInvul()) && (this.bypassesMagic == null || this.bypassesMagic == ajw.isBypassMagic()) && (this.isFire == null || this.isFire == ajw.isFire()) && (this.isMagic == null || this.isMagic == ajw.isMagic()) && (this.isLightning == null || this.isLightning == (ajw == DamageSource.LIGHTNING_BOLT)) && this.directEntity.matches(xd, cvi, ajw.getDirectEntity()) && this.sourceEntity.matches(xd, cvi, ajw.getEntity())); return this == DamageSourcePredicate.ANY || ((this.isProjectile == null || this.isProjectile == ajz.isProjectile()) && (this.isExplosion == null || this.isExplosion == ajz.isExplosion()) && (this.bypassesArmor == null || this.bypassesArmor == ajz.isBypassArmor()) && (this.bypassesInvulnerability == null || this.bypassesInvulnerability == ajz.isBypassInvul()) && (this.bypassesMagic == null || this.bypassesMagic == ajz.isBypassMagic()) && (this.isFire == null || this.isFire == ajz.isFire()) && (this.isMagic == null || this.isMagic == ajz.isMagic()) && (this.isLightning == null || this.isLightning == (ajz == DamageSource.LIGHTNING_BOLT)) && this.directEntity.matches(xd, cvl, ajz.getDirectEntity()) && this.sourceEntity.matches(xd, cvl, ajz.getEntity()));
} }
public static DamageSourcePredicate fromJson(@Nullable final JsonElement jsonElement) { public static DamageSourcePredicate fromJson(@Nullable final JsonElement jsonElement) {

View File

@ -23,8 +23,8 @@ public class EnchantedItemTrigger extends SimpleCriterionTrigger<TriggerInstance
return new TriggerInstance(bj4, d5); return new TriggerInstance(bj4, d5);
} }
public void trigger(final ServerPlayer xe, final ItemStack bek, final int integer) { public void trigger(final ServerPlayer xe, final ItemStack ben, final int integer) {
this.trigger(xe.getAdvancements(), a -> a.matches(bek, integer)); this.trigger(xe.getAdvancements(), a -> a.matches(ben, integer));
} }
static { static {
@ -45,8 +45,8 @@ public class EnchantedItemTrigger extends SimpleCriterionTrigger<TriggerInstance
return new TriggerInstance(ItemPredicate.ANY, MinMaxBounds.Ints.ANY); return new TriggerInstance(ItemPredicate.ANY, MinMaxBounds.Ints.ANY);
} }
public boolean matches(final ItemStack bek, final int integer) { public boolean matches(final ItemStack ben, final int integer) {
return this.item.matches(bek) && this.levels.matches(integer); return this.item.matches(ben) && this.levels.matches(integer);
} }
@Override @Override

View File

@ -24,8 +24,8 @@ public class EnchantmentPredicate {
this.level = MinMaxBounds.Ints.ANY; this.level = MinMaxBounds.Ints.ANY;
} }
public EnchantmentPredicate(@Nullable final Enchantment bhu, final MinMaxBounds.Ints d) { public EnchantmentPredicate(@Nullable final Enchantment bhx, final MinMaxBounds.Ints d) {
this.enchantment = bhu; this.enchantment = bhx;
this.level = d; this.level = d;
} }
@ -67,18 +67,18 @@ public class EnchantmentPredicate {
return EnchantmentPredicate.ANY; return EnchantmentPredicate.ANY;
} }
final JsonObject jsonObject2 = GsonHelper.convertToJsonObject(jsonElement, "enchantment"); final JsonObject jsonObject2 = GsonHelper.convertToJsonObject(jsonElement, "enchantment");
Enchantment bhu3 = null; Enchantment bhx3 = null;
if (jsonObject2.has("enchantment")) { if (jsonObject2.has("enchantment")) {
final ResourceLocation sm4 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "enchantment")); final ResourceLocation sm4 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "enchantment"));
final Object o; final Object o;
final Object obj; final Object obj;
bhu3 = Registry.ENCHANTMENT.getOptional(sm4).<Throwable>orElseThrow(() -> { bhx3 = Registry.ENCHANTMENT.getOptional(sm4).<Throwable>orElseThrow(() -> {
new JsonSyntaxException("Unknown enchantment '" + obj + "'"); new JsonSyntaxException("Unknown enchantment '" + obj + "'");
return o; return o;
}); });
} }
final MinMaxBounds.Ints d4 = MinMaxBounds.Ints.fromJson(jsonObject2.get("levels")); final MinMaxBounds.Ints d4 = MinMaxBounds.Ints.fromJson(jsonObject2.get("levels"));
return new EnchantmentPredicate(bhu3, d4); return new EnchantmentPredicate(bhx3, d4);
} }
public static EnchantmentPredicate[] fromJsonArray(@Nullable final JsonElement jsonElement) { public static EnchantmentPredicate[] fromJsonArray(@Nullable final JsonElement jsonElement) {

View File

@ -24,17 +24,17 @@ public class EnterBlockTrigger extends SimpleCriterionTrigger<TriggerInstance> {
@Override @Override
public TriggerInstance createInstance(final JsonObject jsonObject, final JsonDeserializationContext jsonDeserializationContext) { public TriggerInstance createInstance(final JsonObject jsonObject, final JsonDeserializationContext jsonDeserializationContext) {
final Block bpe4 = deserializeBlock(jsonObject); final Block bph4 = deserializeBlock(jsonObject);
final StatePropertiesPredicate cc5 = StatePropertiesPredicate.fromJson(jsonObject.get("state")); final StatePropertiesPredicate cc5 = StatePropertiesPredicate.fromJson(jsonObject.get("state"));
if (bpe4 != null) { if (bph4 != null) {
final JsonSyntaxException ex; final JsonSyntaxException ex;
final Object obj; final Object obj;
cc5.checkState(bpe4.getStateDefinition(), string -> { cc5.checkState(bph4.getStateDefinition(), string -> {
new JsonSyntaxException("Block " + obj + " has no property " + string); new JsonSyntaxException("Block " + obj + " has no property " + string);
throw ex; throw ex;
}); });
} }
return new TriggerInstance(bpe4, cc5); return new TriggerInstance(bph4, cc5);
} }
@Nullable @Nullable
@ -51,8 +51,8 @@ public class EnterBlockTrigger extends SimpleCriterionTrigger<TriggerInstance> {
return null; return null;
} }
public void trigger(final ServerPlayer xe, final BlockState byg) { public void trigger(final ServerPlayer xe, final BlockState byj) {
this.trigger(xe.getAdvancements(), a -> a.matches(byg)); this.trigger(xe.getAdvancements(), a -> a.matches(byj));
} }
static { static {
@ -63,14 +63,14 @@ public class EnterBlockTrigger extends SimpleCriterionTrigger<TriggerInstance> {
private final Block block; private final Block block;
private final StatePropertiesPredicate state; private final StatePropertiesPredicate state;
public TriggerInstance(@Nullable final Block bpe, final StatePropertiesPredicate cc) { public TriggerInstance(@Nullable final Block bph, final StatePropertiesPredicate cc) {
super(EnterBlockTrigger.ID); super(EnterBlockTrigger.ID);
this.block = bpe; this.block = bph;
this.state = cc; this.state = cc;
} }
public static TriggerInstance entersBlock(final Block bpe) { public static TriggerInstance entersBlock(final Block bph) {
return new TriggerInstance(bpe, StatePropertiesPredicate.ANY); return new TriggerInstance(bph, StatePropertiesPredicate.ANY);
} }
@Override @Override
@ -83,8 +83,8 @@ public class EnterBlockTrigger extends SimpleCriterionTrigger<TriggerInstance> {
return jsonObject2; return jsonObject2;
} }
public boolean matches(final BlockState byg) { public boolean matches(final BlockState byj) {
return (this.block == null || byg.getBlock() == this.block) && this.state.matches(byg); return (this.block == null || byj.getBlock() == this.block) && this.state.matches(byj);
} }
} }
} }

View File

@ -31,15 +31,15 @@ public class EntityEquipmentPredicate {
this.offhand = bj6; this.offhand = bj6;
} }
public boolean matches(@Nullable final Entity akn) { public boolean matches(@Nullable final Entity akq) {
if (this == EntityEquipmentPredicate.ANY) { if (this == EntityEquipmentPredicate.ANY) {
return true; return true;
} }
if (!(akn instanceof LivingEntity)) { if (!(akq instanceof LivingEntity)) {
return false; return false;
} }
final LivingEntity akw3 = (LivingEntity)akn; final LivingEntity akz3 = (LivingEntity)akq;
return this.head.matches(akw3.getItemBySlot(EquipmentSlot.HEAD)) && this.chest.matches(akw3.getItemBySlot(EquipmentSlot.CHEST)) && this.legs.matches(akw3.getItemBySlot(EquipmentSlot.LEGS)) && this.feet.matches(akw3.getItemBySlot(EquipmentSlot.FEET)) && this.mainhand.matches(akw3.getItemBySlot(EquipmentSlot.MAINHAND)) && this.offhand.matches(akw3.getItemBySlot(EquipmentSlot.OFFHAND)); return this.head.matches(akz3.getItemBySlot(EquipmentSlot.HEAD)) && this.chest.matches(akz3.getItemBySlot(EquipmentSlot.CHEST)) && this.legs.matches(akz3.getItemBySlot(EquipmentSlot.LEGS)) && this.feet.matches(akz3.getItemBySlot(EquipmentSlot.FEET)) && this.mainhand.matches(akz3.getItemBySlot(EquipmentSlot.MAINHAND)) && this.offhand.matches(akz3.getItemBySlot(EquipmentSlot.OFFHAND));
} }
public static EntityEquipmentPredicate fromJson(@Nullable final JsonElement jsonElement) { public static EntityEquipmentPredicate fromJson(@Nullable final JsonElement jsonElement) {

View File

@ -29,8 +29,8 @@ public class EntityFlagsPredicate {
this.isBaby = boolean5; this.isBaby = boolean5;
} }
public boolean matches(final Entity akn) { public boolean matches(final Entity akq) {
return (this.isOnFire == null || akn.isOnFire() == this.isOnFire) && (this.isCrouching == null || akn.isCrouching() == this.isCrouching) && (this.isSprinting == null || akn.isSprinting() == this.isSprinting) && (this.isSwimming == null || akn.isSwimming() == this.isSwimming) && (this.isBaby == null || !(akn instanceof LivingEntity) || ((LivingEntity)akn).isBaby() == this.isBaby); return (this.isOnFire == null || akq.isOnFire() == this.isOnFire) && (this.isCrouching == null || akq.isCrouching() == this.isCrouching) && (this.isSprinting == null || akq.isSprinting() == this.isSprinting) && (this.isSwimming == null || akq.isSwimming() == this.isSwimming) && (this.isBaby == null || !(akq instanceof LivingEntity) || ((LivingEntity)akq).isBaby() == this.isBaby);
} }
@Nullable @Nullable

View File

@ -22,8 +22,8 @@ public class EntityHurtPlayerTrigger extends SimpleCriterionTrigger<TriggerInsta
return new TriggerInstance(ar4); return new TriggerInstance(ar4);
} }
public void trigger(final ServerPlayer xe, final DamageSource ajw, final float float3, final float float4, final boolean boolean5) { public void trigger(final ServerPlayer xe, final DamageSource ajz, final float float3, final float float4, final boolean boolean5) {
this.trigger(xe.getAdvancements(), a -> a.matches(xe, ajw, float3, float4, boolean5)); this.trigger(xe.getAdvancements(), a -> a.matches(xe, ajz, float3, float4, boolean5));
} }
static { static {
@ -42,8 +42,8 @@ public class EntityHurtPlayerTrigger extends SimpleCriterionTrigger<TriggerInsta
return new TriggerInstance(a.build()); return new TriggerInstance(a.build());
} }
public boolean matches(final ServerPlayer xe, final DamageSource ajw, final float float3, final float float4, final boolean boolean5) { public boolean matches(final ServerPlayer xe, final DamageSource ajz, final float float3, final float float4, final boolean boolean5) {
return this.damage.matches(xe, ajw, float3, float4, boolean5); return this.damage.matches(xe, ajz, float3, float4, boolean5);
} }
@Override @Override

View File

@ -45,53 +45,53 @@ public class EntityPredicate {
this.catType = sm; this.catType = sm;
} }
public boolean matches(final ServerPlayer xe, @Nullable final Entity akn) { public boolean matches(final ServerPlayer xe, @Nullable final Entity akq) {
return this.matches(xe.getLevel(), xe.position(), akn); return this.matches(xe.getLevel(), xe.position(), akq);
} }
public boolean matches(final ServerLevel xd, @Nullable final Vec3 cvi, @Nullable final Entity akn) { public boolean matches(final ServerLevel xd, @Nullable final Vec3 cvl, @Nullable final Entity akq) {
if (this == EntityPredicate.ANY) { if (this == EntityPredicate.ANY) {
return true; return true;
} }
if (akn == null) { if (akq == null) {
return false; return false;
} }
if (!this.entityType.matches(akn.getType())) { if (!this.entityType.matches(akq.getType())) {
return false; return false;
} }
if (cvi == null) { if (cvl == null) {
if (this.distanceToPlayer != DistancePredicate.ANY) { if (this.distanceToPlayer != DistancePredicate.ANY) {
return false; return false;
} }
} }
else if (!this.distanceToPlayer.matches(cvi.x, cvi.y, cvi.z, akn.getX(), akn.getY(), akn.getZ())) { else if (!this.distanceToPlayer.matches(cvl.x, cvl.y, cvl.z, akq.getX(), akq.getY(), akq.getZ())) {
return false; return false;
} }
if (!this.location.matches(xd, akn.getX(), akn.getY(), akn.getZ())) { if (!this.location.matches(xd, akq.getX(), akq.getY(), akq.getZ())) {
return false; return false;
} }
if (!this.effects.matches(akn)) { if (!this.effects.matches(akq)) {
return false; return false;
} }
if (!this.nbt.matches(akn)) { if (!this.nbt.matches(akq)) {
return false; return false;
} }
if (!this.flags.matches(akn)) { if (!this.flags.matches(akq)) {
return false; return false;
} }
if (!this.equipment.matches(akn)) { if (!this.equipment.matches(akq)) {
return false; return false;
} }
if (!this.player.matches(akn)) { if (!this.player.matches(akq)) {
return false; return false;
} }
if (this.team != null) { if (this.team != null) {
final Team cwk5 = akn.getTeam(); final Team cwn5 = akq.getTeam();
if (cwk5 == null || !this.team.equals(cwk5.getName())) { if (cwn5 == null || !this.team.equals(cwn5.getName())) {
return false; return false;
} }
} }
return this.catType == null || (akn instanceof Cat && ((Cat)akn).getResourceLocation().equals(this.catType)); return this.catType == null || (akq instanceof Cat && ((Cat)akq).getResourceLocation().equals(this.catType));
} }
public static EntityPredicate fromJson(@Nullable final JsonElement jsonElement) { public static EntityPredicate fromJson(@Nullable final JsonElement jsonElement) {
@ -190,8 +190,8 @@ public class EntityPredicate {
return new Builder(); return new Builder();
} }
public Builder of(final EntityType<?> akr) { public Builder of(final EntityType<?> aku) {
this.entityType = EntityTypePredicate.of(akr); this.entityType = EntityTypePredicate.of(aku);
return this; return this;
} }

View File

@ -17,7 +17,7 @@ public abstract class EntityTypePredicate {
public static final EntityTypePredicate ANY; public static final EntityTypePredicate ANY;
private static final Joiner COMMA_JOINER; private static final Joiner COMMA_JOINER;
public abstract boolean matches(final EntityType<?> akr); public abstract boolean matches(final EntityType<?> aku);
public abstract JsonElement serializeToJson(); public abstract JsonElement serializeToJson();
@ -34,15 +34,15 @@ public abstract class EntityTypePredicate {
final ResourceLocation sm3 = new ResourceLocation(string2); final ResourceLocation sm3 = new ResourceLocation(string2);
final Object o; final Object o;
final Object obj; final Object obj;
final EntityType<?> akr4 = Registry.ENTITY_TYPE.getOptional(sm3).<Throwable>orElseThrow(() -> { final EntityType<?> aku4 = Registry.ENTITY_TYPE.getOptional(sm3).<Throwable>orElseThrow(() -> {
new JsonSyntaxException("Unknown entity type '" + obj + "', valid types are: " + EntityTypePredicate.COMMA_JOINER.join(Registry.ENTITY_TYPE.keySet())); new JsonSyntaxException("Unknown entity type '" + obj + "', valid types are: " + EntityTypePredicate.COMMA_JOINER.join(Registry.ENTITY_TYPE.keySet()));
return o; return o;
}); });
return new TypePredicate(akr4); return new TypePredicate(aku4);
} }
public static EntityTypePredicate of(final EntityType<?> akr) { public static EntityTypePredicate of(final EntityType<?> aku) {
return new TypePredicate(akr); return new TypePredicate(aku);
} }
public static EntityTypePredicate of(final Tag<EntityType<?>> aaz) { public static EntityTypePredicate of(final Tag<EntityType<?>> aaz) {
@ -52,7 +52,7 @@ public abstract class EntityTypePredicate {
static { static {
ANY = new EntityTypePredicate() { ANY = new EntityTypePredicate() {
@Override @Override
public boolean matches(final EntityType<?> akr) { public boolean matches(final EntityType<?> aku) {
return true; return true;
} }
@ -67,13 +67,13 @@ public abstract class EntityTypePredicate {
static class TypePredicate extends EntityTypePredicate { static class TypePredicate extends EntityTypePredicate {
private final EntityType<?> type; private final EntityType<?> type;
public TypePredicate(final EntityType<?> akr) { public TypePredicate(final EntityType<?> aku) {
this.type = akr; this.type = aku;
} }
@Override @Override
public boolean matches(final EntityType<?> akr) { public boolean matches(final EntityType<?> aku) {
return this.type == akr; return this.type == aku;
} }
@Override @Override
@ -90,8 +90,8 @@ public abstract class EntityTypePredicate {
} }
@Override @Override
public boolean matches(final EntityType<?> akr) { public boolean matches(final EntityType<?> aku) {
return this.tag.contains(akr); return this.tag.contains(aku);
} }
@Override @Override

View File

@ -22,8 +22,8 @@ public class FilledBucketTrigger extends SimpleCriterionTrigger<TriggerInstance>
return new TriggerInstance(bj4); return new TriggerInstance(bj4);
} }
public void trigger(final ServerPlayer xe, final ItemStack bek) { public void trigger(final ServerPlayer xe, final ItemStack ben) {
this.trigger(xe.getAdvancements(), a -> a.matches(bek)); this.trigger(xe.getAdvancements(), a -> a.matches(ben));
} }
static { static {
@ -42,8 +42,8 @@ public class FilledBucketTrigger extends SimpleCriterionTrigger<TriggerInstance>
return new TriggerInstance(bj); return new TriggerInstance(bj);
} }
public boolean matches(final ItemStack bek) { public boolean matches(final ItemStack ben) {
return this.item.matches(bek); return this.item.matches(ben);
} }
@Override @Override

View File

@ -28,8 +28,8 @@ public class FishingRodHookedTrigger extends SimpleCriterionTrigger<TriggerInsta
return new TriggerInstance(bj4, bb5, bj5); return new TriggerInstance(bj4, bb5, bj5);
} }
public void trigger(final ServerPlayer xe, final ItemStack bek, final FishingHook avt, final Collection<ItemStack> collection) { public void trigger(final ServerPlayer xe, final ItemStack ben, final FishingHook avw, final Collection<ItemStack> collection) {
this.trigger(xe.getAdvancements(), a -> a.matches(xe, bek, avt, collection)); this.trigger(xe.getAdvancements(), a -> a.matches(xe, ben, avw, collection));
} }
static { static {
@ -52,23 +52,23 @@ public class FishingRodHookedTrigger extends SimpleCriterionTrigger<TriggerInsta
return new TriggerInstance(bj1, bb, bj3); return new TriggerInstance(bj1, bb, bj3);
} }
public boolean matches(final ServerPlayer xe, final ItemStack bek, final FishingHook avt, final Collection<ItemStack> collection) { public boolean matches(final ServerPlayer xe, final ItemStack ben, final FishingHook avw, final Collection<ItemStack> collection) {
if (!this.rod.matches(bek)) { if (!this.rod.matches(ben)) {
return false; return false;
} }
if (!this.entity.matches(xe, avt.hookedIn)) { if (!this.entity.matches(xe, avw.hookedIn)) {
return false; return false;
} }
if (this.item != ItemPredicate.ANY) { if (this.item != ItemPredicate.ANY) {
boolean boolean6 = false; boolean boolean6 = false;
if (avt.hookedIn instanceof ItemEntity) { if (avw.hookedIn instanceof ItemEntity) {
final ItemEntity avy7 = (ItemEntity)avt.hookedIn; final ItemEntity awb7 = (ItemEntity)avw.hookedIn;
if (this.item.matches(avy7.getItem())) { if (this.item.matches(awb7.getItem())) {
boolean6 = true; boolean6 = true;
} }
} }
for (final ItemStack bek2 : collection) { for (final ItemStack ben2 : collection) {
if (this.item.matches(bek2)) { if (this.item.matches(ben2)) {
boolean6 = true; boolean6 = true;
break; break;
} }

View File

@ -23,9 +23,9 @@ public class FluidPredicate {
private final Fluid fluid; private final Fluid fluid;
private final StatePropertiesPredicate properties; private final StatePropertiesPredicate properties;
public FluidPredicate(@Nullable final Tag<Fluid> aaz, @Nullable final Fluid cof, final StatePropertiesPredicate cc) { public FluidPredicate(@Nullable final Tag<Fluid> aaz, @Nullable final Fluid coi, final StatePropertiesPredicate cc) {
this.tag = aaz; this.tag = aaz;
this.fluid = cof; this.fluid = coi;
this.properties = cc; this.properties = cc;
} }
@ -36,9 +36,9 @@ public class FluidPredicate {
if (!xd.isLoaded(fk)) { if (!xd.isLoaded(fk)) {
return false; return false;
} }
final FluidState cog4 = xd.getFluidState(fk); final FluidState coj4 = xd.getFluidState(fk);
final Fluid cof5 = cog4.getType(); final Fluid coi5 = coj4.getType();
return (this.tag == null || this.tag.contains(cof5)) && (this.fluid == null || cof5 == this.fluid) && this.properties.matches(cog4); return (this.tag == null || this.tag.contains(coi5)) && (this.fluid == null || coi5 == this.fluid) && this.properties.matches(coj4);
} }
public static FluidPredicate fromJson(@Nullable final JsonElement jsonElement) { public static FluidPredicate fromJson(@Nullable final JsonElement jsonElement) {
@ -46,10 +46,10 @@ public class FluidPredicate {
return FluidPredicate.ANY; return FluidPredicate.ANY;
} }
final JsonObject jsonObject2 = GsonHelper.convertToJsonObject(jsonElement, "fluid"); final JsonObject jsonObject2 = GsonHelper.convertToJsonObject(jsonElement, "fluid");
Fluid cof3 = null; Fluid coi3 = null;
if (jsonObject2.has("fluid")) { if (jsonObject2.has("fluid")) {
final ResourceLocation sm4 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "fluid")); final ResourceLocation sm4 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "fluid"));
cof3 = Registry.FLUID.get(sm4); coi3 = Registry.FLUID.get(sm4);
} }
Tag<Fluid> aaz4 = null; Tag<Fluid> aaz4 = null;
if (jsonObject2.has("tag")) { if (jsonObject2.has("tag")) {
@ -60,7 +60,7 @@ public class FluidPredicate {
} }
} }
final StatePropertiesPredicate cc5 = StatePropertiesPredicate.fromJson(jsonObject2.get("state")); final StatePropertiesPredicate cc5 = StatePropertiesPredicate.fromJson(jsonObject2.get("state"));
return new FluidPredicate(aaz4, cof3, cc5); return new FluidPredicate(aaz4, coi3, cc5);
} }
public JsonElement serializeToJson() { public JsonElement serializeToJson() {

View File

@ -36,8 +36,8 @@ public class InventoryChangeTrigger extends SimpleCriterionTrigger<TriggerInstan
return new TriggerInstance(d5, d6, d7, arr8); return new TriggerInstance(d5, d6, d7, arr8);
} }
public void trigger(final ServerPlayer xe, final Inventory ayf) { public void trigger(final ServerPlayer xe, final Inventory ayi) {
this.trigger(xe.getAdvancements(), a -> a.matches(ayf)); this.trigger(xe.getAdvancements(), a -> a.matches(ayi));
} }
static { static {
@ -90,25 +90,25 @@ public class InventoryChangeTrigger extends SimpleCriterionTrigger<TriggerInstan
return jsonObject2; return jsonObject2;
} }
public boolean matches(final Inventory ayf) { public boolean matches(final Inventory ayi) {
int integer3 = 0; int integer3 = 0;
int integer4 = 0; int integer4 = 0;
int integer5 = 0; int integer5 = 0;
final List<ItemPredicate> list6 = Lists.<ItemPredicate>newArrayList(this.predicates); final List<ItemPredicate> list6 = Lists.<ItemPredicate>newArrayList(this.predicates);
for (int integer6 = 0; integer6 < ayf.getContainerSize(); ++integer6) { for (int integer6 = 0; integer6 < ayi.getContainerSize(); ++integer6) {
final ItemStack bek8 = ayf.getItem(integer6); final ItemStack ben8 = ayi.getItem(integer6);
if (bek8.isEmpty()) { if (ben8.isEmpty()) {
++integer4; ++integer4;
} }
else { else {
++integer5; ++integer5;
if (bek8.getCount() >= bek8.getMaxStackSize()) { if (ben8.getCount() >= ben8.getMaxStackSize()) {
++integer3; ++integer3;
} }
final Iterator<ItemPredicate> iterator9 = list6.iterator(); final Iterator<ItemPredicate> iterator9 = list6.iterator();
while (iterator9.hasNext()) { while (iterator9.hasNext()) {
final ItemPredicate bj10 = iterator9.next(); final ItemPredicate bj10 = iterator9.next();
if (bj10.matches(bek8)) { if (bj10.matches(ben8)) {
iterator9.remove(); iterator9.remove();
} }
} }

View File

@ -24,8 +24,8 @@ public class ItemDurabilityTrigger extends SimpleCriterionTrigger<TriggerInstanc
return new TriggerInstance(bj4, d5, d6); return new TriggerInstance(bj4, d5, d6);
} }
public void trigger(final ServerPlayer xe, final ItemStack bek, final int integer) { public void trigger(final ServerPlayer xe, final ItemStack ben, final int integer) {
this.trigger(xe.getAdvancements(), a -> a.matches(bek, integer)); this.trigger(xe.getAdvancements(), a -> a.matches(ben, integer));
} }
static { static {
@ -48,8 +48,8 @@ public class ItemDurabilityTrigger extends SimpleCriterionTrigger<TriggerInstanc
return new TriggerInstance(bj, d, MinMaxBounds.Ints.ANY); return new TriggerInstance(bj, d, MinMaxBounds.Ints.ANY);
} }
public boolean matches(final ItemStack bek, final int integer) { public boolean matches(final ItemStack ben, final int integer) {
return this.item.matches(bek) && this.durability.matches(bek.getMaxDamage() - integer) && this.delta.matches(bek.getDamageValue() - integer); return this.item.matches(ben) && this.durability.matches(ben.getMaxDamage() - integer) && this.delta.matches(ben.getDamageValue() - integer);
} }
@Override @Override

View File

@ -50,41 +50,41 @@ public class ItemPredicate {
this.nbt = NbtPredicate.ANY; this.nbt = NbtPredicate.ANY;
} }
public ItemPredicate(@Nullable final Tag<Item> aaz, @Nullable final Item bef, final MinMaxBounds.Ints d3, final MinMaxBounds.Ints d4, final EnchantmentPredicate[] arr5, final EnchantmentPredicate[] arr6, @Nullable final Potion bga, final NbtPredicate bt) { public ItemPredicate(@Nullable final Tag<Item> aaz, @Nullable final Item bei, final MinMaxBounds.Ints d3, final MinMaxBounds.Ints d4, final EnchantmentPredicate[] arr5, final EnchantmentPredicate[] arr6, @Nullable final Potion bgd, final NbtPredicate bt) {
this.tag = aaz; this.tag = aaz;
this.item = bef; this.item = bei;
this.count = d3; this.count = d3;
this.durability = d4; this.durability = d4;
this.enchantments = arr5; this.enchantments = arr5;
this.storedEnchantments = arr6; this.storedEnchantments = arr6;
this.potion = bga; this.potion = bgd;
this.nbt = bt; this.nbt = bt;
} }
public boolean matches(final ItemStack bek) { public boolean matches(final ItemStack ben) {
if (this == ItemPredicate.ANY) { if (this == ItemPredicate.ANY) {
return true; return true;
} }
if (this.tag != null && !this.tag.contains(bek.getItem())) { if (this.tag != null && !this.tag.contains(ben.getItem())) {
return false; return false;
} }
if (this.item != null && bek.getItem() != this.item) { if (this.item != null && ben.getItem() != this.item) {
return false; return false;
} }
if (!this.count.matches(bek.getCount())) { if (!this.count.matches(ben.getCount())) {
return false; return false;
} }
if (!this.durability.isAny() && !bek.isDamageableItem()) { if (!this.durability.isAny() && !ben.isDamageableItem()) {
return false; return false;
} }
if (!this.durability.matches(bek.getMaxDamage() - bek.getDamageValue())) { if (!this.durability.matches(ben.getMaxDamage() - ben.getDamageValue())) {
return false; return false;
} }
if (!this.nbt.matches(bek)) { if (!this.nbt.matches(ben)) {
return false; return false;
} }
if (this.enchantments.length > 0) { if (this.enchantments.length > 0) {
final Map<Enchantment, Integer> map3 = EnchantmentHelper.deserializeEnchantments(bek.getEnchantmentTags()); final Map<Enchantment, Integer> map3 = EnchantmentHelper.deserializeEnchantments(ben.getEnchantmentTags());
for (final EnchantmentPredicate aw7 : this.enchantments) { for (final EnchantmentPredicate aw7 : this.enchantments) {
if (!aw7.containedIn(map3)) { if (!aw7.containedIn(map3)) {
return false; return false;
@ -92,15 +92,15 @@ public class ItemPredicate {
} }
} }
if (this.storedEnchantments.length > 0) { if (this.storedEnchantments.length > 0) {
final Map<Enchantment, Integer> map3 = EnchantmentHelper.deserializeEnchantments(EnchantedBookItem.getEnchantments(bek)); final Map<Enchantment, Integer> map3 = EnchantmentHelper.deserializeEnchantments(EnchantedBookItem.getEnchantments(ben));
for (final EnchantmentPredicate aw7 : this.storedEnchantments) { for (final EnchantmentPredicate aw7 : this.storedEnchantments) {
if (!aw7.containedIn(map3)) { if (!aw7.containedIn(map3)) {
return false; return false;
} }
} }
} }
final Potion bga3 = PotionUtils.getPotion(bek); final Potion bgd3 = PotionUtils.getPotion(ben);
return this.potion == null || this.potion == bga3; return this.potion == null || this.potion == bgd3;
} }
public static ItemPredicate fromJson(@Nullable final JsonElement jsonElement) { public static ItemPredicate fromJson(@Nullable final JsonElement jsonElement) {
@ -114,12 +114,12 @@ public class ItemPredicate {
throw new JsonParseException("Disallowed data tag found"); throw new JsonParseException("Disallowed data tag found");
} }
final NbtPredicate bt5 = NbtPredicate.fromJson(jsonObject2.get("nbt")); final NbtPredicate bt5 = NbtPredicate.fromJson(jsonObject2.get("nbt"));
Item bef6 = null; Item bei6 = null;
if (jsonObject2.has("item")) { if (jsonObject2.has("item")) {
final ResourceLocation sm7 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "item")); final ResourceLocation sm7 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "item"));
final Object o; final Object o;
final Object obj; final Object obj;
bef6 = Registry.ITEM.getOptional(sm7).<Throwable>orElseThrow(() -> { bei6 = Registry.ITEM.getOptional(sm7).<Throwable>orElseThrow(() -> {
new JsonSyntaxException("Unknown item id '" + obj + "'"); new JsonSyntaxException("Unknown item id '" + obj + "'");
return o; return o;
}); });
@ -132,19 +132,19 @@ public class ItemPredicate {
throw new JsonSyntaxException("Unknown item tag '" + sm8 + "'"); throw new JsonSyntaxException("Unknown item tag '" + sm8 + "'");
} }
} }
Potion bga8 = null; Potion bgd8 = null;
if (jsonObject2.has("potion")) { if (jsonObject2.has("potion")) {
final ResourceLocation sm9 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "potion")); final ResourceLocation sm9 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "potion"));
final Object o2; final Object o2;
final Object obj2; final Object obj2;
bga8 = Registry.POTION.getOptional(sm9).<Throwable>orElseThrow(() -> { bgd8 = Registry.POTION.getOptional(sm9).<Throwable>orElseThrow(() -> {
new JsonSyntaxException("Unknown potion '" + obj2 + "'"); new JsonSyntaxException("Unknown potion '" + obj2 + "'");
return o2; return o2;
}); });
} }
final EnchantmentPredicate[] arr9 = EnchantmentPredicate.fromJsonArray(jsonObject2.get("enchantments")); final EnchantmentPredicate[] arr9 = EnchantmentPredicate.fromJsonArray(jsonObject2.get("enchantments"));
final EnchantmentPredicate[] arr10 = EnchantmentPredicate.fromJsonArray(jsonObject2.get("stored_enchantments")); final EnchantmentPredicate[] arr10 = EnchantmentPredicate.fromJsonArray(jsonObject2.get("stored_enchantments"));
return new ItemPredicate(aaz7, bef6, d3, d4, arr9, arr10, bga8, bt5); return new ItemPredicate(aaz7, bei6, d3, d4, arr9, arr10, bgd8, bt5);
} }
public JsonElement serializeToJson() { public JsonElement serializeToJson() {
@ -222,8 +222,8 @@ public class ItemPredicate {
return new Builder(); return new Builder();
} }
public Builder of(final ItemLike bjs) { public Builder of(final ItemLike bjv) {
this.item = bjs.asItem(); this.item = bjv.asItem();
return this; return this;
} }

View File

@ -32,9 +32,9 @@ public class ItemUsedOnBlockTrigger extends SimpleCriterionTrigger<TriggerInstan
return new TriggerInstance(this.id, aj4, cc5, bj6); return new TriggerInstance(this.id, aj4, cc5, bj6);
} }
public void trigger(final ServerPlayer xe, final BlockPos fk, final ItemStack bek) { public void trigger(final ServerPlayer xe, final BlockPos fk, final ItemStack ben) {
final BlockState byg5 = xe.getLevel().getBlockState(fk); final BlockState byj5 = xe.getLevel().getBlockState(fk);
this.trigger(xe.getAdvancements(), a -> a.matches(byg5, xe.getLevel(), fk, bek)); this.trigger(xe.getAdvancements(), a -> a.matches(byj5, xe.getLevel(), fk, ben));
} }
public static class TriggerInstance extends AbstractCriterionTriggerInstance { public static class TriggerInstance extends AbstractCriterionTriggerInstance {
@ -53,8 +53,8 @@ public class ItemUsedOnBlockTrigger extends SimpleCriterionTrigger<TriggerInstan
return new TriggerInstance(CriteriaTriggers.SAFELY_HARVEST_HONEY.id, a.build(), StatePropertiesPredicate.ANY, a.build()); return new TriggerInstance(CriteriaTriggers.SAFELY_HARVEST_HONEY.id, a.build(), StatePropertiesPredicate.ANY, a.build());
} }
public boolean matches(final BlockState byg, final ServerLevel xd, final BlockPos fk, final ItemStack bek) { public boolean matches(final BlockState byj, final ServerLevel xd, final BlockPos fk, final ItemStack ben) {
return this.block.matches(xd, fk) && this.state.matches(byg) && this.item.matches(bek); return this.block.matches(xd, fk) && this.state.matches(byj) && this.item.matches(ben);
} }
@Override @Override

View File

@ -69,8 +69,8 @@ public class KilledByCrossbowTrigger extends SimpleCriterionTrigger<TriggerInsta
boolean boolean10 = false; boolean boolean10 = false;
final Iterator<Entity> iterator11 = list5.iterator(); final Iterator<Entity> iterator11 = list5.iterator();
while (iterator11.hasNext()) { while (iterator11.hasNext()) {
final Entity akn12 = iterator11.next(); final Entity akq12 = iterator11.next();
if (bb9.matches(xe, akn12)) { if (bb9.matches(xe, akq12)) {
iterator11.remove(); iterator11.remove();
boolean10 = true; boolean10 = true;
break; break;
@ -83,8 +83,8 @@ public class KilledByCrossbowTrigger extends SimpleCriterionTrigger<TriggerInsta
} }
if (this.uniqueEntityTypes != MinMaxBounds.Ints.ANY) { if (this.uniqueEntityTypes != MinMaxBounds.Ints.ANY) {
final Set<EntityType<?>> set5 = Sets.newHashSet(); final Set<EntityType<?>> set5 = Sets.newHashSet();
for (final Entity akn13 : collection) { for (final Entity akq13 : collection) {
set5.add(akn13.getType()); set5.add(akq13.getType());
} }
return this.uniqueEntityTypes.matches(set5.size()) && this.uniqueEntityTypes.matches(integer); return this.uniqueEntityTypes.matches(set5.size()) && this.uniqueEntityTypes.matches(integer);
} }

View File

@ -27,8 +27,8 @@ public class KilledTrigger extends SimpleCriterionTrigger<TriggerInstance> {
return new TriggerInstance(this.id, EntityPredicate.fromJson(jsonObject.get("entity")), DamageSourcePredicate.fromJson(jsonObject.get("killing_blow"))); return new TriggerInstance(this.id, EntityPredicate.fromJson(jsonObject.get("entity")), DamageSourcePredicate.fromJson(jsonObject.get("killing_blow")));
} }
public void trigger(final ServerPlayer xe, final Entity akn, final DamageSource ajw) { public void trigger(final ServerPlayer xe, final Entity akq, final DamageSource ajz) {
this.trigger(xe.getAdvancements(), a -> a.matches(xe, akn, ajw)); this.trigger(xe.getAdvancements(), a -> a.matches(xe, akq, ajz));
} }
public static class TriggerInstance extends AbstractCriterionTriggerInstance { public static class TriggerInstance extends AbstractCriterionTriggerInstance {
@ -57,8 +57,8 @@ public class KilledTrigger extends SimpleCriterionTrigger<TriggerInstance> {
return new TriggerInstance(CriteriaTriggers.ENTITY_KILLED_PLAYER.id, EntityPredicate.ANY, DamageSourcePredicate.ANY); return new TriggerInstance(CriteriaTriggers.ENTITY_KILLED_PLAYER.id, EntityPredicate.ANY, DamageSourcePredicate.ANY);
} }
public boolean matches(final ServerPlayer xe, final Entity akn, final DamageSource ajw) { public boolean matches(final ServerPlayer xe, final Entity akq, final DamageSource ajz) {
return this.killingBlow.matches(xe, ajw) && this.entityPredicate.matches(xe, akn); return this.killingBlow.matches(xe, ajz) && this.entityPredicate.matches(xe, akq);
} }
@Override @Override

View File

@ -23,8 +23,8 @@ public class LevitationTrigger extends SimpleCriterionTrigger<TriggerInstance> {
return new TriggerInstance(at4, d5); return new TriggerInstance(at4, d5);
} }
public void trigger(final ServerPlayer xe, final Vec3 cvi, final int integer) { public void trigger(final ServerPlayer xe, final Vec3 cvl, final int integer) {
this.trigger(xe.getAdvancements(), a -> a.matches(xe, cvi, integer)); this.trigger(xe.getAdvancements(), a -> a.matches(xe, cvl, integer));
} }
static { static {
@ -45,8 +45,8 @@ public class LevitationTrigger extends SimpleCriterionTrigger<TriggerInstance> {
return new TriggerInstance(at, MinMaxBounds.Ints.ANY); return new TriggerInstance(at, MinMaxBounds.Ints.ANY);
} }
public boolean matches(final ServerPlayer xe, final Vec3 cvi, final int integer) { public boolean matches(final ServerPlayer xe, final Vec3 cvl, final int integer) {
return this.distance.matches(cvi.x, cvi.y, cvi.z, xe.getX(), xe.getY(), xe.getZ()) && this.duration.matches(integer); return this.distance.matches(cvl.x, cvl.y, cvl.z, xe.getX(), xe.getY(), xe.getZ()) && this.duration.matches(integer);
} }
@Override @Override

View File

@ -31,28 +31,28 @@ public class LocationPredicate {
private final BlockPredicate block; private final BlockPredicate block;
private final FluidPredicate fluid; private final FluidPredicate fluid;
public LocationPredicate(final MinMaxBounds.Floats c1, final MinMaxBounds.Floats c2, final MinMaxBounds.Floats c3, @Nullable final Biome bkq, @Nullable final StructureFeature<?> cfi, @Nullable final DimensionType cbf, final LightPredicate bo, final BlockPredicate aj, final FluidPredicate bf) { public LocationPredicate(final MinMaxBounds.Floats c1, final MinMaxBounds.Floats c2, final MinMaxBounds.Floats c3, @Nullable final Biome bkt, @Nullable final StructureFeature<?> cfl, @Nullable final DimensionType cbi, final LightPredicate bo, final BlockPredicate aj, final FluidPredicate bf) {
this.x = c1; this.x = c1;
this.y = c2; this.y = c2;
this.z = c3; this.z = c3;
this.biome = bkq; this.biome = bkt;
this.feature = cfi; this.feature = cfl;
this.dimension = cbf; this.dimension = cbi;
this.light = bo; this.light = bo;
this.block = aj; this.block = aj;
this.fluid = bf; this.fluid = bf;
} }
public static LocationPredicate inBiome(final Biome bkq) { public static LocationPredicate inBiome(final Biome bkt) {
return new LocationPredicate(MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, bkq, null, null, LightPredicate.ANY, BlockPredicate.ANY, FluidPredicate.ANY); return new LocationPredicate(MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, bkt, null, null, LightPredicate.ANY, BlockPredicate.ANY, FluidPredicate.ANY);
} }
public static LocationPredicate inDimension(final DimensionType cbf) { public static LocationPredicate inDimension(final DimensionType cbi) {
return new LocationPredicate(MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, null, null, cbf, LightPredicate.ANY, BlockPredicate.ANY, FluidPredicate.ANY); return new LocationPredicate(MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, null, null, cbi, LightPredicate.ANY, BlockPredicate.ANY, FluidPredicate.ANY);
} }
public static LocationPredicate inFeature(final StructureFeature<?> cfi) { public static LocationPredicate inFeature(final StructureFeature<?> cfl) {
return new LocationPredicate(MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, null, cfi, null, LightPredicate.ANY, BlockPredicate.ANY, FluidPredicate.ANY); return new LocationPredicate(MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, MinMaxBounds.Floats.ANY, null, cfl, null, LightPredicate.ANY, BlockPredicate.ANY, FluidPredicate.ANY);
} }
public boolean matches(final ServerLevel xd, final double double2, final double double3, final double double4) { public boolean matches(final ServerLevel xd, final double double2, final double double3, final double double4) {
@ -113,14 +113,14 @@ public class LocationPredicate {
final MinMaxBounds.Floats c4 = MinMaxBounds.Floats.fromJson(jsonObject3.get("x")); final MinMaxBounds.Floats c4 = MinMaxBounds.Floats.fromJson(jsonObject3.get("x"));
final MinMaxBounds.Floats c5 = MinMaxBounds.Floats.fromJson(jsonObject3.get("y")); final MinMaxBounds.Floats c5 = MinMaxBounds.Floats.fromJson(jsonObject3.get("y"));
final MinMaxBounds.Floats c6 = MinMaxBounds.Floats.fromJson(jsonObject3.get("z")); final MinMaxBounds.Floats c6 = MinMaxBounds.Floats.fromJson(jsonObject3.get("z"));
final DimensionType cbf7 = jsonObject2.has("dimension") ? DimensionType.getByName(new ResourceLocation(GsonHelper.getAsString(jsonObject2, "dimension"))) : null; final DimensionType cbi7 = jsonObject2.has("dimension") ? DimensionType.getByName(new ResourceLocation(GsonHelper.getAsString(jsonObject2, "dimension"))) : null;
final StructureFeature<?> cfi8 = jsonObject2.has("feature") ? Feature.STRUCTURES_REGISTRY.get(GsonHelper.getAsString(jsonObject2, "feature")) : null; final StructureFeature<?> cfl8 = jsonObject2.has("feature") ? Feature.STRUCTURES_REGISTRY.get(GsonHelper.getAsString(jsonObject2, "feature")) : null;
Biome bkq9 = null; Biome bkt9 = null;
if (jsonObject2.has("biome")) { if (jsonObject2.has("biome")) {
final ResourceLocation sm10 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "biome")); final ResourceLocation sm10 = new ResourceLocation(GsonHelper.getAsString(jsonObject2, "biome"));
final Object o; final Object o;
final Object obj; final Object obj;
bkq9 = Registry.BIOME.getOptional(sm10).<Throwable>orElseThrow(() -> { bkt9 = Registry.BIOME.getOptional(sm10).<Throwable>orElseThrow(() -> {
new JsonSyntaxException("Unknown biome '" + obj + "'"); new JsonSyntaxException("Unknown biome '" + obj + "'");
return o; return o;
}); });
@ -128,7 +128,7 @@ public class LocationPredicate {
final LightPredicate bo10 = LightPredicate.fromJson(jsonObject2.get("light")); final LightPredicate bo10 = LightPredicate.fromJson(jsonObject2.get("light"));
final BlockPredicate aj11 = BlockPredicate.fromJson(jsonObject2.get("block")); final BlockPredicate aj11 = BlockPredicate.fromJson(jsonObject2.get("block"));
final FluidPredicate bf12 = FluidPredicate.fromJson(jsonObject2.get("fluid")); final FluidPredicate bf12 = FluidPredicate.fromJson(jsonObject2.get("fluid"));
return new LocationPredicate(c4, c5, c6, bkq9, cfi8, cbf7, bo10, aj11, bf12); return new LocationPredicate(c4, c5, c6, bkt9, cfl8, cbi7, bo10, aj11, bf12);
} }
static { static {
@ -162,8 +162,8 @@ public class LocationPredicate {
return new Builder(); return new Builder();
} }
public Builder setBiome(@Nullable final Biome bkq) { public Builder setBiome(@Nullable final Biome bkt) {
this.biome = bkq; this.biome = bkt;
return this; return this;
} }

Some files were not shown because too many files have changed in this diff Show More