Search in sources :

Example 1 with MultiplayerWarningScreen

use of net.minecraft.client.gui.screen.multiplayer.MultiplayerWarningScreen in project KiwiClient by TangyKiwi.

the class MainMenu method mouseClicked.

public boolean mouseClicked(double mouseX, double mouseY, int button) {
    for (int i = 0; i < 6; i++) {
        String b = BUTTONS[i];
        GuiButton guiButton = buttonList.get(i);
        float x = guiButton.x;
        float y = guiButton.y;
        if (mouseX >= x - guiButton.width / 2 && mouseY >= y && mouseX <= x + guiButton.width / 2 && mouseY <= y + 60) {
            this.client.getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
            switch(b) {
                case "Singleplayer":
                    this.client.setScreen(new SelectWorldScreen(this));
                    break;
                case "Multiplayer":
                    Screen screen = this.client.options.skipMultiplayerWarning ? new MultiplayerScreen(this) : new MultiplayerWarningScreen(this);
                    this.client.setScreen(screen);
                    break;
                case "Realms":
                    this.client.setScreen(new RealmsMainScreen(this));
                    break;
                case "Options":
                    this.client.setScreen(new OptionsScreen(this, this.client.options));
                    break;
                case "Language":
                    this.client.setScreen(new LanguageOptionsScreen(this, this.client.options, this.client.getLanguageManager()));
                    break;
                case "Quit":
                    this.client.scheduleStop();
                    break;
            }
        }
    }
    return super.mouseClicked(mouseX, mouseY, button);
}
Also used : MultiplayerScreen(net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen) InventoryScreen(net.minecraft.client.gui.screen.ingame.InventoryScreen) SelectWorldScreen(net.minecraft.client.gui.screen.world.SelectWorldScreen) MultiplayerWarningScreen(net.minecraft.client.gui.screen.multiplayer.MultiplayerWarningScreen) LanguageOptionsScreen(net.minecraft.client.gui.screen.option.LanguageOptionsScreen) OptionsScreen(net.minecraft.client.gui.screen.option.OptionsScreen) Screen(net.minecraft.client.gui.screen.Screen) MultiplayerScreen(net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen) RealmsMainScreen(net.minecraft.client.realms.gui.screen.RealmsMainScreen) LanguageOptionsScreen(net.minecraft.client.gui.screen.option.LanguageOptionsScreen) OptionsScreen(net.minecraft.client.gui.screen.option.OptionsScreen) MultiplayerWarningScreen(net.minecraft.client.gui.screen.multiplayer.MultiplayerWarningScreen) RealmsMainScreen(net.minecraft.client.realms.gui.screen.RealmsMainScreen) SelectWorldScreen(net.minecraft.client.gui.screen.world.SelectWorldScreen) LanguageOptionsScreen(net.minecraft.client.gui.screen.option.LanguageOptionsScreen)

Aggregations

Screen (net.minecraft.client.gui.screen.Screen)1 InventoryScreen (net.minecraft.client.gui.screen.ingame.InventoryScreen)1 MultiplayerScreen (net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen)1 MultiplayerWarningScreen (net.minecraft.client.gui.screen.multiplayer.MultiplayerWarningScreen)1 LanguageOptionsScreen (net.minecraft.client.gui.screen.option.LanguageOptionsScreen)1 OptionsScreen (net.minecraft.client.gui.screen.option.OptionsScreen)1 SelectWorldScreen (net.minecraft.client.gui.screen.world.SelectWorldScreen)1 RealmsMainScreen (net.minecraft.client.realms.gui.screen.RealmsMainScreen)1