Search in sources :

Example 1 with GuiMultiplayer

use of net.minecraft.client.gui.GuiMultiplayer in project Almura by AlmuraDev.

the class ServerMenu method onButtonClick.

@Subscribe
public void onButtonClick(UIButton.ClickEvent event) throws IOException, URISyntaxException {
    if (!event.getComponent().getName().toLowerCase().equals("button.server.web") || (!event.getComponent().getName().toLowerCase().equals("button.server.map"))) {
        // This doesn't close this screen when connecting to a server.
        close();
    }
    switch(event.getComponent().getName().toLowerCase()) {
        case "button.server.almura.live":
            FMLClientHandler.instance().setupServerList();
            FMLClientHandler.instance().connectToServer(this, DATA_LIVE_SERVER_CONNECT);
            break;
        case "button.server.almura.dev":
            FMLClientHandler.instance().setupServerList();
            FMLClientHandler.instance().connectToServer(this, DATA_DEV_SERVER_CONNECT);
            break;
        case "button.server.another":
            mc.displayGuiScreen(new GuiMultiplayer(this));
            break;
        case "button.server.map":
            Desktop.getDesktop().browse(new URI("http://srv1.almuramc.com:8123"));
            break;
        case "button.server.web":
            Desktop.getDesktop().browse(new URI("http://www.almuramc.com"));
            break;
    }
}
Also used : URI(java.net.URI) GuiMultiplayer(net.minecraft.client.gui.GuiMultiplayer) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

Subscribe (com.google.common.eventbus.Subscribe)1 URI (java.net.URI)1 GuiMultiplayer (net.minecraft.client.gui.GuiMultiplayer)1