This commit is contained in:
kirillsaint 2023-08-29 12:19:24 +06:00
parent 00f17cacf7
commit 317ea3ff1b
2 changed files with 10 additions and 3 deletions

View File

@ -11,7 +11,6 @@ import net.silentclient.client.gui.elements.IconButton;
import net.silentclient.client.gui.elements.Input;
import net.silentclient.client.gui.font.SilentFontRenderer;
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
import net.silentclient.client.gui.minecraft.GuiConnecting;
import net.silentclient.client.gui.theme.Theme;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.NotificationUtils;
@ -63,7 +62,7 @@ public class DirectConnectGui extends SilentScreen {
this.serverData.serverIP = this.silentInputs.get(0).getValue().trim();
this.mc.gameSettings.lastServer = this.silentInputs.get(0).getValue().trim();
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(new GuiConnecting(parentScreen, this.mc, new ServerData(serverData.serverName, serverData.serverIP, false)));
this.parentScreen.connect(new ServerData(serverData.serverName, serverData.serverIP, false));
break;
}
}

View File

@ -160,10 +160,18 @@ public class SilentMultiplayerGui extends SilentScreen {
public void connectToSelected() {
ServerData server = savedServerList.getServerData(selectedServer);
if(server != null) {
this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, new ServerData(server.serverName, server.serverIP, false)));
this.connect(new ServerData(server.serverName, server.serverIP, false));
}
}
public void connect(ServerData serverData) {
if(this.mc.theWorld != null) {
this.mc.theWorld.sendQuittingDisconnectingPacket();
this.mc.loadWorld(null);
}
this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, serverData));
}
public boolean canUpSwap(int index)
{
return index > 0;