Class GameModeSwitcherScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement

public class GameModeSwitcherScreen extends Screen
  • Field Details

  • Constructor Details

    • GameModeSwitcherScreen

      public GameModeSwitcherScreen()
  • Method Details

    • getDefaultSelected

      private GameType getDefaultSelected()
    • init

      protected void init()
      Overrides:
      init in class Screen
    • render

      public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Screen
      Parameters:
      pGuiGraphics - the GuiGraphics object used for rendering.
      pMouseX - the x-coordinate of the mouse cursor.
      pMouseY - the y-coordinate of the mouse cursor.
      pPartialTick - the partial tick time.
    • renderBackground

      public void renderBackground(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Overrides:
      renderBackground in class Screen
    • switchToHoveredGameMode

      private void switchToHoveredGameMode()
    • switchToHoveredGameMode

      private static void switchToHoveredGameMode(Minecraft pMinecraft, GameModeSwitcherScreen.GameModeIcon pGameModeIcon)
    • checkToClose

      private boolean checkToClose()
    • keyPressed

      public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers)
      Called when a keyboard key is pressed within the GUI element.

      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class Screen
      Parameters:
      pKeyCode - the key code of the pressed key.
      pScanCode - the scan code of the pressed key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • isPauseScreen

      public boolean isPauseScreen()
      Overrides:
      isPauseScreen in class Screen