Class BattleScreen

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement

public class BattleScreen extends ChattableCameraScreen
GUI for battles.
  • Field Details

    • bm

      The client-side battle manager.
    • pokemonOverlay

      public OverlayBase pokemonOverlay
      The Pixelmon overlay accompanying the GUI.
    • battleLog

      public BattleLogElement battleLog
    • showGlobalInfo

      public boolean showGlobalInfo
    • MIN_HEIGHT_FOR_COMBINED_BACKGROUND_AND_POPUP

      public static final int MIN_HEIGHT_FOR_COMBINED_BACKGROUND_AND_POPUP
      See Also:
    • MIN_WIDTH_FOR_COMBINED_BACKGROUND_AND_POPUP

      public static final int MIN_WIDTH_FOR_COMBINED_BACKGROUND_AND_POPUP
      See Also:
  • Constructor Details

    • BattleScreen

      public BattleScreen()
      Initializes the GUI and its possible screens.
  • Method Details

    • init

      public void init()
      Overrides:
      init in class ChattableCameraScreen
    • restoreSettingsAndClose

      public void restoreSettingsAndClose()
      Closes the battle GUI.
    • restoreSettingsAndCloseStatic

      public static void restoreSettingsAndCloseStatic(@Nullable ClientBattleManager bm)
    • removed

      public void removed()
      Overrides:
      removed in class ChattableCameraScreen
    • selectScreenImmediate

      public void selectScreenImmediate(BattleMode mode)
      Changes the current screen immediately, without waiting for a tick update.
      Parameters:
      mode - The screen to change to.
    • drawHealthBar

      public static void drawHealthBar(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, float health, int maxHealth)
      Draws a Pokémon's health bar.
      Parameters:
      x - The x coordinate of the health bar.
      y - The y coordinate of the health bar.
      width - The width of the health bar.
      height - The height of the health bar.
      health - The current hp of the Pokémon.
      maxHealth - The maximum hp of the Pokémon.
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      keyPressed in class ChattableCameraScreen
    • charTyped

      public boolean charTyped(char key, int keyCode)
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      charTyped in class ChattableCameraScreen
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseClicked in class ChattableCameraScreen
    • render

      public void render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
      Draws the screen and all the components in it.
      Specified by:
      render in interface net.minecraft.client.gui.components.Renderable
      Overrides:
      render in class ChattableCameraScreen
    • tick

      public void tick()
      Overrides:
      tick in class ChattableCameraScreen
    • getGuiWidth

      public int getGuiWidth()
      Gets the width of the battle GUI.
      Returns:
      The width of the battle GUI.
    • getGuiHeight

      public int getGuiHeight()
      Gets the height of the battle GUI.
      Returns:
      The height of the battle GUI.
    • canSelectTarget

      public boolean canSelectTarget(Attack attack)
      Checks if a target needs to be selected for the attack.
      Parameters:
      attack - The attack being selected.
      Returns:
      Whether a target needs to be selected for the attack.
    • setTargeting

      public boolean setTargeting(PixelmonClientData pig, Attack attack, int opponentTarget, int userTarget)
      Sets the targets of an attack.
      Parameters:
      attack - The attack to target.
      opponentTarget - The index of the opponent that the player is targeting, or -1 if the player is not targeting an opponent.
      userTarget - The index of the allied Pokémon that the player is targeting, or -1 if the player is not targeting an ally.
      Returns:
      Whether the player is hovering their mouse over a potential target.
    • isTargeted

      public boolean isTargeted(UUID uuid)
    • showTargeting

      public boolean showTargeting()
    • actionPerformed

      protected void actionPerformed(net.minecraft.client.gui.components.Button button)
    • resize

      public void resize(net.minecraft.client.Minecraft mc, int w, int h)
      Overrides:
      resize in class net.minecraft.client.gui.screens.Screen
    • chooseAttackUsingKeyPress

      public boolean chooseAttackUsingKeyPress(int attackID)
    • toggleAttackGimmickUsingKeyPress

      public boolean toggleAttackGimmickUsingKeyPress()
    • chooseBagUsingKeyPress

      public boolean chooseBagUsingKeyPress()
    • closeBagUsingKeyPress

      public boolean closeBagUsingKeyPress()
    • chooseBagSectionOrItemToUseFromKeyPress

      public boolean chooseBagSectionOrItemToUseFromKeyPress(int keyCode)
    • applyItemToPokemonFromKeyPress

      public boolean applyItemToPokemonFromKeyPress(int keyCode)
    • chooseToFleeOrForfeitUsingKeyPress

      public boolean chooseToFleeOrForfeitUsingKeyPress()
    • chooseNoToForfeitingUsingKeyPress

      public boolean chooseNoToForfeitingUsingKeyPress()
    • pressEnterToConfirmForfeiting

      public boolean pressEnterToConfirmForfeiting(int keyCode)
    • choosePokemonTeamUsingKeyPress

      public boolean choosePokemonTeamUsingKeyPress()
    • closePokemonTeamUsingKeyPress

      public boolean closePokemonTeamUsingKeyPress()
    • choosePokemonToSendOutFromKeyPress

      public boolean choosePokemonToSendOutFromKeyPress(int keyCode)
    • scrollBattleLogUpOrDownFromKeyPress

      public boolean scrollBattleLogUpOrDownFromKeyPress(int keyCode)
    • hoverBagOrPokemonMenuItemFromKeyPress

      public boolean hoverBagOrPokemonMenuItemFromKeyPress(int keyCode)
    • hoverAttackTargetFromKeyPress

      public boolean hoverAttackTargetFromKeyPress(int keyCode)
    • chooseLeftRightArrowsInMenuFromKeyPress

      public boolean chooseLeftRightArrowsInMenuFromKeyPress(int keyCode)
    • pressEscapeToGoBackInMenu

      public boolean pressEscapeToGoBackInMenu(int keyCode)