From d1bcfe3fd49eb267c1f40b363b5e2add2f5cc558 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Sat, 22 Jul 2023 14:27:29 +0600 Subject: [PATCH] Fixed Mappings --- .../net/silentclient/client/gui/GuiMultiplayerInGame.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) {