Search in sources :

Example 1 with GuiConnecting

use of net.minecraft.client.multiplayer.GuiConnecting in project MinecraftForge by MinecraftForge.

the class FMLClientHandler method connectToServerAtStartup.

public void connectToServerAtStartup(String host, int port) {
    setupServerList();
    ServerPinger osp = new ServerPinger();
    ServerData serverData = new ServerData("Command Line", host + ":" + port, false);
    try {
        osp.ping(serverData);
        startupConnectionData.await(30, TimeUnit.SECONDS);
    } catch (Exception e) {
        showGuiScreen(new GuiConnecting(new GuiMainMenu(), client, host, port));
        return;
    }
    connectToServer(new GuiMainMenu(), serverData);
}
Also used : GuiMainMenu(net.minecraft.client.gui.GuiMainMenu) ServerData(net.minecraft.client.multiplayer.ServerData) GuiConnecting(net.minecraft.client.multiplayer.GuiConnecting) ServerPinger(net.minecraft.client.network.ServerPinger) WrongMinecraftVersionException(net.minecraftforge.fml.common.WrongMinecraftVersionException) DuplicateModsFoundException(net.minecraftforge.fml.common.DuplicateModsFoundException) LoaderException(net.minecraftforge.fml.common.LoaderException) IOException(java.io.IOException) ModSortingException(net.minecraftforge.fml.common.toposort.ModSortingException) MissingModsException(net.minecraftforge.fml.common.MissingModsException) Java8VersionException(net.minecraftforge.fml.common.Java8VersionException)

Example 2 with GuiConnecting

use of net.minecraft.client.multiplayer.GuiConnecting in project Wurst-MC-1.10 by Wurst-Imperium.

the class ServerHook method reconnectToLastServer.

public static void reconnectToLastServer(GuiScreen prevScreen) {
    if (lastServer == null)
        return;
    currentServerIP = lastServer.getServerData().serverIP;
    if (!currentServerIP.contains(":"))
        currentServerIP += ":25565";
    Minecraft mc = Minecraft.getMinecraft();
    mc.displayGuiScreen(new GuiConnecting(prevScreen, mc, lastServer.getServerData()));
}
Also used : GuiConnecting(net.minecraft.client.multiplayer.GuiConnecting) Minecraft(net.minecraft.client.Minecraft)

Example 3 with GuiConnecting

use of net.minecraft.client.multiplayer.GuiConnecting in project Wurst-MC-1.12 by Wurst-Imperium.

the class JoinCmd method execute.

@Override
public void execute(String[] args) throws CmdError {
    if (args.length != 1)
        syntaxError();
    Minecraft mc = Minecraft.getMinecraft();
    mc.addScheduledTask(() -> {
        mc.displayGuiScreen(new GuiConnecting(new GuiWurstMainMenu(), mc, new ServerData("", args[0], false)));
        System.out.println("Joined " + args[0] + " as " + mc.session.getUsername());
    });
}
Also used : GuiConnecting(net.minecraft.client.multiplayer.GuiConnecting) ServerData(net.minecraft.client.multiplayer.ServerData) GuiWurstMainMenu(net.wurstclient.gui.main.GuiWurstMainMenu) Minecraft(net.minecraft.client.Minecraft)

Example 4 with GuiConnecting

use of net.minecraft.client.multiplayer.GuiConnecting in project Wurst-MC-1.9 by Wurst-Imperium.

the class ServerHook method reconnectToLastServer.

public static void reconnectToLastServer(GuiScreen prevScreen) {
    if (lastServer == null)
        return;
    currentServerIP = lastServer.getServerData().serverIP;
    if (!currentServerIP.contains(":"))
        currentServerIP += ":25565";
    Minecraft mc = Minecraft.getMinecraft();
    mc.displayGuiScreen(new GuiConnecting(prevScreen, mc, lastServer.getServerData()));
}
Also used : GuiConnecting(net.minecraft.client.multiplayer.GuiConnecting) Minecraft(net.minecraft.client.Minecraft)

Example 5 with GuiConnecting

use of net.minecraft.client.multiplayer.GuiConnecting in project Wurst-MC-1.12 by Wurst-Imperium.

the class ServerHook method reconnectToLastServer.

public static void reconnectToLastServer(GuiScreen prevScreen) {
    if (lastServer == null)
        return;
    currentServerIP = lastServer.getServerData().serverIP;
    if (!currentServerIP.contains(":"))
        currentServerIP += ":25565";
    Minecraft mc = Minecraft.getMinecraft();
    mc.displayGuiScreen(new GuiConnecting(prevScreen, mc, lastServer.getServerData()));
}
Also used : GuiConnecting(net.minecraft.client.multiplayer.GuiConnecting) Minecraft(net.minecraft.client.Minecraft) WMinecraft(net.wurstclient.compatibility.WMinecraft)

Aggregations

GuiConnecting (net.minecraft.client.multiplayer.GuiConnecting)7 Minecraft (net.minecraft.client.Minecraft)6 WMinecraft (net.wurstclient.compatibility.WMinecraft)3 ServerData (net.minecraft.client.multiplayer.ServerData)2 IOException (java.io.IOException)1 GuiMainMenu (net.minecraft.client.gui.GuiMainMenu)1 ServerPinger (net.minecraft.client.network.ServerPinger)1 DuplicateModsFoundException (net.minecraftforge.fml.common.DuplicateModsFoundException)1 Java8VersionException (net.minecraftforge.fml.common.Java8VersionException)1 LoaderException (net.minecraftforge.fml.common.LoaderException)1 MissingModsException (net.minecraftforge.fml.common.MissingModsException)1 WrongMinecraftVersionException (net.minecraftforge.fml.common.WrongMinecraftVersionException)1 ModSortingException (net.minecraftforge.fml.common.toposort.ModSortingException)1 GuiWurstMainMenu (net.wurstclient.gui.main.GuiWurstMainMenu)1