This commit is contained in:
kirillsaint 2023-08-27 19:01:27 +06:00
parent 738fcf83e2
commit be6627e741
2 changed files with 7 additions and 13 deletions

View File

@ -1,16 +1,12 @@
package net.silentclient.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiScreenServerList;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.resources.I18n;
import net.silentclient.client.mixin.ducks.GuiMultiplayerExt;
import net.silentclient.client.gui.multiplayer.SilentMultiplayerGui;
import java.io.IOException;
public class GuiMultiplayerInGame extends GuiMultiplayer {
public class GuiMultiplayerInGame extends SilentMultiplayerGui {
public GuiMultiplayerInGame(GuiScreen parentScreen) {
super(parentScreen);
@ -22,12 +18,6 @@ public class GuiMultiplayerInGame extends GuiMultiplayer {
disconnect();
}
if(button.id == 4) {
((GuiMultiplayerExt) this).silent$setDirectConnect(true);
((GuiMultiplayerExt) this).silent$setSelectedServer(new ServerData(I18n.format("selectServer.defaultName"), "", false));
this.mc.displayGuiScreen(new GuiScreenServerList(this, new ServerData(I18n.format("selectServer.defaultName"), "", false)));
}
super.actionPerformed(button);
}
@ -42,7 +32,7 @@ public class GuiMultiplayerInGame extends GuiMultiplayer {
this.mc.theWorld.sendQuittingDisconnectingPacket();
this.mc.loadWorld(null);
this.mc.displayGuiScreen(null);
((GuiMultiplayerExt) this).silent$setParentScreen(null);
this.setParentScreen(null);
}
}

View File

@ -320,4 +320,8 @@ public class SilentMultiplayerGui extends SilentScreen {
public ServerList getServerList() {
return savedServerList;
}
public void setParentScreen(GuiScreen parentScreen) {
this.parentScreen = parentScreen;
}
}