Class TradingScreen

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.pixelmonmod.pixelmon.client.gui.TradingScreen
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 TradingScreen extends net.minecraft.client.gui.screens.Screen
GUI when using a trade machine.
  • 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
    boolean
    Whether the player is ready to trade.

    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
    TradingScreen(int x, int y, int z)
    Initializes the trade GUI.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    drawButtonReady(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY)
    Draws a button to mark the player as ready to trade.
    boolean
    drawButtonTrade(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY)
    Draws a button to allow the player to trade.
    void
    drawPokemonSelection(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY)
    Draws a rectangle around the selected Pokémon.
    boolean
    hoveredButtonReady(double mouseX, double mouseY)
    Checks if the mouse is hovering over the ready button.
    boolean
    hoveredButtonTrade(double mouseX, double mouseY)
    Checks if the mouse is hovering over the trade button.
    int
    hoveredPokemonSelectionIndex(double mouseX, double mouseY)
    Checks if the mouse is hovering over a Pokémon.
    boolean
    isOverCloseButton(double mouseX, double mouseY)
    Draws a button to close the GUI.
    boolean
    Returns true if this GUI should pause the game when it is displayed in single-player
    boolean
    mouseClicked(double mouseX, double mouseY, int mouseButton)
     
    void
     
    void
    render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
     

    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, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, keyPressed, narrationEnabled, onClose, onFilesDrop, openLink, rebuildWidgets, removeWidget, renderBackground, renderDirtBackground, renderTransparentBackground, renderWithTooltip, repositionElements, resize, runNarration, scheduleNarration, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, shouldRunNarration, suppressNarration, tick, 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

    charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, magicalSpecialHackyFocus, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocused

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

    mouseMoved

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

    getTabOrderGroup
  • Field Details

    • ready

      public boolean ready
      Whether the player is ready to trade.
  • Constructor Details

    • TradingScreen

      public TradingScreen(int x, int y, int z)
      Initializes the trade GUI.
  • Method Details

    • removed

      public void removed()
      Overrides:
      removed in class net.minecraft.client.gui.screens.Screen
    • render

      public void render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
      Specified by:
      render in interface net.minecraft.client.gui.components.Renderable
      Overrides:
      render in class net.minecraft.client.gui.screens.Screen
    • hoveredPokemonSelectionIndex

      public int hoveredPokemonSelectionIndex(double mouseX, double mouseY)
      Checks if the mouse is hovering over a Pokémon.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
      Returns:
      The index of the party Pokémon that the mouse is over, or -1 if not.
    • drawPokemonSelection

      public void drawPokemonSelection(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY)
      Draws a rectangle around the selected Pokémon.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
    • hoveredButtonTrade

      public boolean hoveredButtonTrade(double mouseX, double mouseY)
      Checks if the mouse is hovering over the trade button.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
      Returns:
      Whether the coordinates of the mouse are within the bounds of the trade button.
    • drawButtonTrade

      public boolean drawButtonTrade(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY)
      Draws a button to allow the player to trade.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
      Returns:
      Whether the mouse is over the trade button.
    • isOverCloseButton

      public boolean isOverCloseButton(double mouseX, double mouseY)
      Draws a button to close the GUI.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
      Returns:
      Whether the mouse is over the close button.
    • hoveredButtonReady

      public boolean hoveredButtonReady(double mouseX, double mouseY)
      Checks if the mouse is hovering over the ready button.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
      Returns:
      Whether the coordinates of the mouse are within the boundaries of the ready button.
    • drawButtonReady

      public boolean drawButtonReady(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY)
      Draws a button to mark the player as ready to trade.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
      Returns:
      Whether the mouse is over the ready button.
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
    • isPauseScreen

      public boolean isPauseScreen()
      Returns true if this GUI should pause the game when it is displayed in single-player
      Overrides:
      isPauseScreen in class net.minecraft.client.gui.screens.Screen