Search in sources :

Example 1 with GuiOptions

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

the class SimpleIngameMenu method onButtonClick.

@Subscribe
public void onButtonClick(UIButton.ClickEvent event) throws IOException, URISyntaxException {
    switch(event.getComponent().getName().toLowerCase(Locale.ENGLISH)) {
        case "button.back":
            this.close();
            break;
        case "button.shop":
            Desktop.getDesktop().browse(new URI(GuiConfig.Url.SHOP));
            break;
        case "button.guide":
            if (this.mc.player != null) {
                this.close();
            }
            break;
        case "button.instance":
            Desktop.getDesktop().browse(new URI(GuiConfig.Url.MAP));
            break;
        case "button.statistics":
            Desktop.getDesktop().browse(new URI(GuiConfig.Url.STATISTICS));
            break;
        case "button.advancements":
            close();
            if (this.mc.player != null) {
                this.mc.displayGuiScreen(new GuiScreenAdvancements(this.mc.player.connection.getAdvancementManager()));
            }
            break;
        case "button.forums":
            Desktop.getDesktop().browse(new URI(GuiConfig.Url.FORUM));
            break;
        case "button.lan":
            this.mc.displayGuiScreen(new GuiShareToLan(this));
            break;
        case "button.options":
            this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
            break;
        case "button.quit":
            close();
            this.mc.world.sendQuittingDisconnectingPacket();
            this.mc.loadWorld(null);
            this.mc.displayGuiScreen(new GuiMainMenu());
            break;
    }
}
Also used : GuiMainMenu(net.minecraft.client.gui.GuiMainMenu) GuiScreenAdvancements(net.minecraft.client.gui.advancements.GuiScreenAdvancements) GuiShareToLan(net.minecraft.client.gui.GuiShareToLan) GuiOptions(net.minecraft.client.gui.GuiOptions) URI(java.net.URI) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

Subscribe (com.google.common.eventbus.Subscribe)1 URI (java.net.URI)1 GuiMainMenu (net.minecraft.client.gui.GuiMainMenu)1 GuiOptions (net.minecraft.client.gui.GuiOptions)1 GuiShareToLan (net.minecraft.client.gui.GuiShareToLan)1 GuiScreenAdvancements (net.minecraft.client.gui.advancements.GuiScreenAdvancements)1