fix Connect
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m12s

This commit is contained in:
Daniella / Tove 2024-06-25 10:57:34 +02:00
parent 465e2be922
commit 9ff2b22257
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -3,7 +3,7 @@ package de.com.baseband.client.feature.commands;
import de.com.baseband.client.feature.Feature;
import de.com.baseband.client.feature.category.Command;
import de.com.baseband.prod.LoadHandler;
import net.minecraft.client.multiplayer.GuiConnecting;
import net.minecraftforge.fml.client.FMLClientHandler;
import static de.com.baseband.client.BaseBand.LOGGER;
@ -26,7 +26,7 @@ public class Connect extends Feature {
if((args.length == 1 || args.length == 2) && notIngame()) {
assert mc.currentScreen != null; // notIngame => in a menu => gui is not null
try {
mc.displayGuiScreen(new GuiConnecting(mc.currentScreen, mc, args[0], args.length == 2 ? Integer.parseInt(args[1]) : 25565));
FMLClientHandler.instance().connectToServerAtStartup(args[0], args.length == 2 ? Integer.parseInt(args[1]) : 25565);
} catch (NumberFormatException e) {
LOGGER.warn("Port invalid");
}