package me.deftware.mixin.mixins.gui;

import me.deftware.client.framework.minecraft.Minecraft;
import me.deftware.client.framework.util.minecraft.ServerConnectionInfo;
import net.minecraft.client.gui.screen.ConnectScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ConnectScreen.class)
public class MixinGuiConnecting {

    @Inject(method = "connect", at = @At("HEAD"))
    private void connect(String ip, int port, CallbackInfo ci) {
        Minecraft.lastConnectedServer = new ServerConnectionInfo("Server", ip + ":" + port, false);
    }

}

@@ -194,32 +194,128 @@
 ent.
-gui.screen.ConnectScreen
+MinecraftClient;%0Aimport net.minecraft.client.gui.screen.ConnectScreen;%0Aimport net.minecraft.client.network.ServerAddress
 ;%0Aim
@@ -617,16 +617,101 @@
 %22connect
+(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/network/ServerAddress;)V
 %22, at = 
@@ -752,27 +752,53 @@
 ect(
-String ip, int port
+MinecraftClient client, ServerAddress address
 , Ca
@@ -893,23 +893,54 @@
 r%22, 
-ip + %22:%22 + p
+address.getAddress() + %22:%22 + address.getP
 ort
+()
 , fa

Fix crash