Search in sources :

Example 1 with ServerListEntryLanDetected

use of net.minecraft.client.gui.ServerListEntryLanDetected in project Wurst-MC-1.12 by Wurst-Imperium.

the class ServerHook method updateLastServerFromServerlist.

public static void updateLastServerFromServerlist(IGuiListEntry entry, GuiMultiplayer guiMultiplayer) {
    if (entry instanceof ServerListEntryNormal) {
        currentServerIP = ((ServerListEntryNormal) entry).getServerData().serverIP;
        if (!currentServerIP.contains(":"))
            currentServerIP += ":25565";
        lastServer = (ServerListEntryNormal) (guiMultiplayer.serverListSelector.getSelected() < 0 ? null : guiMultiplayer.serverListSelector.getListEntry(guiMultiplayer.serverListSelector.getSelected()));
    } else if (entry instanceof ServerListEntryLanDetected) {
        currentServerIP = ((ServerListEntryLanDetected) entry).getServerData().getServerIpPort();
        lastServer = new ServerListEntryNormal(guiMultiplayer, new ServerData("LAN-Server", currentServerIP, false));
    }
}
Also used : ServerListEntryLanDetected(net.minecraft.client.gui.ServerListEntryLanDetected) ServerData(net.minecraft.client.multiplayer.ServerData) ServerListEntryNormal(net.minecraft.client.gui.ServerListEntryNormal)

Example 2 with ServerListEntryLanDetected

use of net.minecraft.client.gui.ServerListEntryLanDetected in project Wurst-MC-1.9 by Wurst-Imperium.

the class ServerHook method updateLastServerFromServerlist.

public static void updateLastServerFromServerlist(IGuiListEntry entry, GuiMultiplayer guiMultiplayer) {
    if (entry instanceof ServerListEntryNormal) {
        currentServerIP = ((ServerListEntryNormal) entry).getServerData().serverIP;
        if (!currentServerIP.contains(":"))
            currentServerIP += ":25565";
        lastServer = (ServerListEntryNormal) (guiMultiplayer.serverListSelector.getSelectedServer() < 0 ? null : guiMultiplayer.serverListSelector.getListEntry(guiMultiplayer.serverListSelector.getSelectedServer()));
    } else if (entry instanceof ServerListEntryLanDetected) {
        currentServerIP = ((ServerListEntryLanDetected) entry).getLanServer().getServerIpPort();
        lastServer = new ServerListEntryNormal(guiMultiplayer, new ServerData("LAN-Server", currentServerIP, false));
    }
}
Also used : ServerListEntryLanDetected(net.minecraft.client.gui.ServerListEntryLanDetected) ServerData(net.minecraft.client.multiplayer.ServerData) ServerListEntryNormal(net.minecraft.client.gui.ServerListEntryNormal)

Example 3 with ServerListEntryLanDetected

use of net.minecraft.client.gui.ServerListEntryLanDetected in project Wurst-MC-1.12-OF by Wurst-Imperium.

the class ServerHook method updateLastServerFromServerlist.

public static void updateLastServerFromServerlist(IGuiListEntry entry, GuiMultiplayer guiMultiplayer) {
    if (entry instanceof ServerListEntryNormal) {
        currentServerIP = ((ServerListEntryNormal) entry).getServerData().serverIP;
        if (!currentServerIP.contains(":"))
            currentServerIP += ":25565";
        lastServer = (ServerListEntryNormal) (guiMultiplayer.serverListSelector.getSelected() < 0 ? null : guiMultiplayer.serverListSelector.getListEntry(guiMultiplayer.serverListSelector.getSelected()));
    } else if (entry instanceof ServerListEntryLanDetected) {
        currentServerIP = ((ServerListEntryLanDetected) entry).getServerData().getServerIpPort();
        lastServer = new ServerListEntryNormal(guiMultiplayer, new ServerData("LAN-Server", currentServerIP, false));
    }
}
Also used : ServerListEntryLanDetected(net.minecraft.client.gui.ServerListEntryLanDetected) ServerData(net.minecraft.client.multiplayer.ServerData) ServerListEntryNormal(net.minecraft.client.gui.ServerListEntryNormal)

Example 4 with ServerListEntryLanDetected

use of net.minecraft.client.gui.ServerListEntryLanDetected in project Wurst-MC-1.10 by Wurst-Imperium.

the class ServerHook method updateLastServerFromServerlist.

public static void updateLastServerFromServerlist(IGuiListEntry entry, GuiMultiplayer guiMultiplayer) {
    if (entry instanceof ServerListEntryNormal) {
        currentServerIP = ((ServerListEntryNormal) entry).getServerData().serverIP;
        if (!currentServerIP.contains(":"))
            currentServerIP += ":25565";
        lastServer = (ServerListEntryNormal) (guiMultiplayer.serverListSelector.getSelected() < 0 ? null : guiMultiplayer.serverListSelector.getListEntry(guiMultiplayer.serverListSelector.getSelected()));
    } else if (entry instanceof ServerListEntryLanDetected) {
        currentServerIP = ((ServerListEntryLanDetected) entry).getLanServer().getServerIpPort();
        lastServer = new ServerListEntryNormal(guiMultiplayer, new ServerData("LAN-Server", currentServerIP, false));
    }
}
Also used : ServerListEntryLanDetected(net.minecraft.client.gui.ServerListEntryLanDetected) ServerData(net.minecraft.client.multiplayer.ServerData) ServerListEntryNormal(net.minecraft.client.gui.ServerListEntryNormal)

Example 5 with ServerListEntryLanDetected

use of net.minecraft.client.gui.ServerListEntryLanDetected in project Wurst-MC-1.11 by Wurst-Imperium.

the class ServerHook method updateLastServerFromServerlist.

public static void updateLastServerFromServerlist(IGuiListEntry entry, GuiMultiplayer guiMultiplayer) {
    if (entry instanceof ServerListEntryNormal) {
        currentServerIP = ((ServerListEntryNormal) entry).getServerData().serverIP;
        if (!currentServerIP.contains(":"))
            currentServerIP += ":25565";
        lastServer = (ServerListEntryNormal) (guiMultiplayer.serverListSelector.getSelected() < 0 ? null : guiMultiplayer.serverListSelector.getListEntry(guiMultiplayer.serverListSelector.getSelected()));
    } else if (entry instanceof ServerListEntryLanDetected) {
        currentServerIP = ((ServerListEntryLanDetected) entry).getServerData().getServerIpPort();
        lastServer = new ServerListEntryNormal(guiMultiplayer, new ServerData("LAN-Server", currentServerIP, false));
    }
}
Also used : ServerListEntryLanDetected(net.minecraft.client.gui.ServerListEntryLanDetected) ServerData(net.minecraft.client.multiplayer.ServerData) ServerListEntryNormal(net.minecraft.client.gui.ServerListEntryNormal)

Aggregations

ServerListEntryLanDetected (net.minecraft.client.gui.ServerListEntryLanDetected)5 ServerListEntryNormal (net.minecraft.client.gui.ServerListEntryNormal)5 ServerData (net.minecraft.client.multiplayer.ServerData)5