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.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen

    net.minecraft.client.gui.screens.Screen.NarratableSearchResult
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    The client-side battle manager.
    The Pixelmon overlay accompanying the GUI.
    boolean
     

    Fields inherited from class com.pixelmonmod.pixelmon.client.camera.ChattableCameraScreen

    chat

    Fields inherited from class com.pixelmonmod.pixelmon.client.camera.CameraScreen

    allowUserInput, mouseDown

    Fields inherited from class net.minecraft.client.gui.screens.Screen

    BACKGROUND_LOCATION, children, font, height, minecraft, renderables, screenExecutor, title, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes the GUI and its possible screens.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    actionPerformed(net.minecraft.client.gui.components.Button button)
     
    boolean
    Checks if a target needs to be selected for the attack.
    boolean
    charTyped(char key, int keyCode)
     
    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.
    int
    Gets the height of the battle GUI.
    int
    Gets the width of the battle GUI.
    void
     
    boolean
     
    boolean
    keyPressed(int keyCode, int scanCode, int modifiers)
     
    boolean
    mouseClicked(double mouseX, double mouseY, int mouseButton)
     
    void
     
    void
    render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
    Draws the screen and all the components in it.
    void
    resize(net.minecraft.client.Minecraft mc, int w, int h)
     
    void
    Closes the battle GUI.
    static void
     
    void
    Changes the current screen immediately, without waiting for a tick update.
    boolean
    setTargeting(PixelmonClientData pig, Attack attack, int opponentTarget, int userTarget)
    Sets the targets of an attack.
    boolean
     
    void
     

    Methods inherited from class com.pixelmonmod.pixelmon.client.camera.ChattableCameraScreen

    mouseDragged, mouseMoved, mouseReleased, mouseScrolled

    Methods inherited from class com.pixelmonmod.pixelmon.client.camera.CameraScreen

    getCamera, isPauseScreen, renderBackground, renderDirtBackground

    Methods inherited from class net.minecraft.client.gui.screens.Screen

    added, addEventWidget, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearWidgets, confirmLink, createArrowEvent, createTabEvent, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, hideWidgets, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrationEnabled, onClose, onFilesDrop, openLink, rebuildWidgets, removeWidget, renderTransparentBackground, renderWithTooltip, repositionElements, runNarration, scheduleNarration, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, shouldRunNarration, suppressNarration, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, wrapScreenError

    Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler

    getFocused, isDragging, setDragging, setFocused

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler

    getChildAt, getCurrentFocusPath, isFocused, keyReleased, magicalSpecialHackyFocus, nextFocusPath, setFocused

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • 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
  • 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