diff --git a/src/main/java/net/silentclient/client/gui/GuiMultiplayerInGame.java b/src/main/java/net/silentclient/client/gui/GuiMultiplayerInGame.java index eaea9fc..81e0478 100644 --- a/src/main/java/net/silentclient/client/gui/GuiMultiplayerInGame.java +++ b/src/main/java/net/silentclient/client/gui/GuiMultiplayerInGame.java @@ -8,6 +8,7 @@ import net.minecraft.client.multiplayer.ServerData; import net.minecraft.client.resources.I18n; import net.silentclient.client.Client; import net.silentclient.client.mixin.accessors.GuiMultiplayerAccessor; +import net.silentclient.client.utils.ClientUtils; import java.io.IOException; import java.lang.reflect.Field; @@ -29,7 +30,7 @@ public class GuiMultiplayerInGame extends GuiMultiplayer { try { Class clazz = this.getClass(); Object cc = clazz.newInstance(); - Field f1 = cc.getClass().getSuperclass().getDeclaredField("selectedServer"); + Field f1 = cc.getClass().getSuperclass().getDeclaredField(ClientUtils.isDevelopment() ? "selectedServer" : "z"); f1.setAccessible(true); f1.set(cc, new ServerData(I18n.format("selectServer.defaultName"), "", false)); this.mc.displayGuiScreen(new GuiScreenServerList(this, (ServerData) f1.get(cc))); @@ -55,7 +56,7 @@ public class GuiMultiplayerInGame extends GuiMultiplayer { try { Class clazz = this.getClass(); Object cc = clazz.newInstance(); - Field f1 = cc.getClass().getSuperclass().getDeclaredField("parentScreen"); + Field f1 = cc.getClass().getSuperclass().getDeclaredField(ClientUtils.isDevelopment() ? "parentScreen" : "g"); f1.setAccessible(true); f1.set(cc, null); } catch (Exception err) {