Search in sources :

Example 1 with ServerPinger

use of net.minecraft.client.network.ServerPinger 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)

Aggregations

IOException (java.io.IOException)1 GuiMainMenu (net.minecraft.client.gui.GuiMainMenu)1 GuiConnecting (net.minecraft.client.multiplayer.GuiConnecting)1 ServerData (net.minecraft.client.multiplayer.ServerData)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