Merge pull request #28 from Silent-Client/TEST2

Fix
This commit is contained in:
kirillsaint 2023-08-29 12:23:04 +06:00 committed by GitHub
commit 625f1ec21c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;