From 280137bd97490c1ddba1f6179d001c8ca831d76e Mon Sep 17 00:00:00 2001 From: LAX1DUDE Date: Wed, 30 Mar 2022 17:13:19 -0700 Subject: [PATCH] Update GuiDisconnected.java --- .../net/minecraft/src/GuiDisconnected.java | 48 ++++++++++++++----- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/minecraft/src/GuiDisconnected.java b/src/main/java/net/minecraft/src/GuiDisconnected.java index cae4b43..c6570c4 100644 --- a/src/main/java/net/minecraft/src/GuiDisconnected.java +++ b/src/main/java/net/minecraft/src/GuiDisconnected.java @@ -3,6 +3,9 @@ package net.minecraft.src; import java.util.Iterator; import java.util.List; +import net.lax1dude.eaglercraft.ConfigConstants; +import net.lax1dude.eaglercraft.EaglerAdapter; + public class GuiDisconnected extends GuiScreen { /** The error message. */ private String errorMessage; @@ -16,7 +19,7 @@ public class GuiDisconnected extends GuiScreen { public GuiDisconnected(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object... par4ArrayOfObj) { StringTranslate var5 = StringTranslate.getInstance(); this.field_98095_n = par1GuiScreen; - this.errorMessage = var5.translateKey(par2Str); + this.errorMessage = par2Str.equals("disconnect.requiresAuth") ? par2Str : var5.translateKey(par2Str); this.errorDetail = par3Str; this.field_74247_c = par4ArrayOfObj; } @@ -34,12 +37,14 @@ public class GuiDisconnected extends GuiScreen { public void initGui() { StringTranslate var1 = StringTranslate.getInstance(); this.buttonList.clear(); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, var1.translateKey("gui.toMenu"))); - - if (this.field_74247_c != null) { - this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(var1.translateKeyFormat(this.errorDetail, this.field_74247_c), this.width - 50); - } else { - this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(var1.translateKey(this.errorDetail), this.width - 50); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, !"disconnect.requiresAuth".equals(this.errorMessage) ? this.height / 4 + 120 + 12 : this.height - this.height / 5 - 40, var1.translateKey("gui.toMenu"))); + + if(!"disconnect.requiresAuth".equals(this.errorMessage)) { + if (this.field_74247_c != null) { + this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(var1.translateKeyFormat(this.errorDetail, this.field_74247_c), this.width - 50); + } else { + this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(var1.translateKey(this.errorDetail), this.width - 50); + } } } @@ -58,13 +63,32 @@ public class GuiDisconnected extends GuiScreen { */ public void drawScreen(int par1, int par2, float par3) { this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, this.height / 2 - 50, 11184810); int var4 = this.height / 2 - 30; + + if("disconnect.requiresAuth".equals(this.errorMessage)) {//22w12a + EaglerAdapter.glPushMatrix(); + EaglerAdapter.glScalef(1.5f, 1.5f, 1.5f); + this.drawCenteredString(this.fontRenderer, "Authentication Required", this.width / 3, this.height / 4 - 30, 0xDD5555); + EaglerAdapter.glPopMatrix(); + this.drawCenteredString(this.fontRenderer, "This server requires a paid Minecraft account to join", this.width / 2, this.height / 2 - 55, 0xDDDD44); + this.drawCenteredString(this.fontRenderer, "You are running Eaglercraft " + EnumChatFormatting.GRAY + ConfigConstants.version + EnumChatFormatting.RESET + " which does not", this.width / 2, this.height / 2 - 35, 0x44BB44); + this.drawCenteredString(this.fontRenderer, "support Xbox Live sign-in, so this server is inaccessable", this.width / 2, this.height / 2 - 23, 0x44BB44); - if (this.field_74245_d != null) { - for (Iterator var5 = this.field_74245_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { - String var6 = (String) var5.next(); - this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215); + EaglerAdapter.glPushMatrix(); + EaglerAdapter.glScalef(1.0f, 1.0f, 1.0f); + this.drawCenteredString(this.fontRenderer, "Please contact the owner of this site to update, or", this.width / 2, this.height / 2 - 3, 0x666666); + this.drawCenteredString(this.fontRenderer, "if you want to continue playing Eaglercraft without a", this.width / 2, this.height / 2 + 5, 0x666666); + this.drawCenteredString(this.fontRenderer, "real Minecraft account then please choose to play on", this.width / 2, this.height / 2 + 14, 0x666666); + this.drawCenteredString(this.fontRenderer, "an older server that does still you to play for free", this.width / 2, this.height / 2 + 23, 0x666666); + EaglerAdapter.glPopMatrix(); + + }else { + this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, this.height / 2 - 50, 11184810); + if (this.field_74245_d != null) { + for (Iterator var5 = this.field_74245_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { + String var6 = (String) var5.next(); + this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215); + } } }