Class AbstractShopScreen

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.pixelmonmod.pixelmon.client.gui.npc.AbstractShopScreen
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
Direct Known Subclasses:
ShopkeeperScreen, VendingMachineScreen

public abstract class AbstractShopScreen extends net.minecraft.client.gui.screens.Screen
  • 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
    protected List<ShopItem>
     
    protected int
    The index that is currently scrolled to in the buy tab.
    protected EnumBuySell
     
    protected float
    The buy/sell quantity of the selected item in float.
    protected int
    The buy/sell quantity of the currently selected item.
    protected int
    The index of the currently selected item.
    protected boolean
     
    protected List<ShopItem>
     
    protected int
    The index that is currently scrolled to in the sell tab.
    protected List<ShopItem>
     

    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
    Modifier
    Constructor
    Description
    protected
    AbstractShopScreen(List<ShopItem> shopItems, boolean sellable)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    clickBuyMiniScreen(double mouseX, double mouseY, boolean isInstant)
    Processes held mouse input on the quantity selection screen.
    protected void
    clickBuyScreen(double mouseX, double mouseY)
     
    protected boolean
     
    boolean
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double deltaX, double deltaY)
     
    void
     
    void
    renderBackground(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
     
    protected void
    renderBuyScreen(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY)
     
    void
    renderDirtBackground(net.minecraft.client.gui.GuiGraphics p_282281_)
     
    protected void
    renderMenu(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY)
    Renders the list of items displayed in the current tab.
    protected void
    Sends a packet to the server when buying an item.
    protected void
    Sends a packet to the server when selling an item.

    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, onFilesDrop, openLink, rebuildWidgets, removed, removeWidget, render, 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, mouseClicked, mouseDragged, mouseReleased, 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

    • shopItems

      protected List<ShopItem> shopItems
    • sellItems

      protected List<ShopItem> sellItems
    • buyItems

      protected List<ShopItem> buyItems
    • sellable

      protected boolean sellable
    • selectedItem

      protected int selectedItem
      The index of the currently selected item.
    • quantity

      protected int quantity
      The buy/sell quantity of the currently selected item.
    • floatQuantity

      protected float floatQuantity
      The buy/sell quantity of the selected item in float.
    • buyStartIndex

      protected int buyStartIndex
      The index that is currently scrolled to in the buy tab.
    • sellStartIndex

      protected int sellStartIndex
      The index that is currently scrolled to in the sell tab.
    • currentTab

      protected EnumBuySell currentTab
  • Constructor Details

    • AbstractShopScreen

      protected AbstractShopScreen(List<ShopItem> shopItems, boolean sellable)
  • Method Details

    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double deltaX, double deltaY)
    • isBuyMiniScreenVisible

      protected boolean isBuyMiniScreenVisible()
    • clickBuyScreen

      protected void clickBuyScreen(double mouseX, double mouseY)
    • clickBuyMiniScreen

      protected void clickBuyMiniScreen(double mouseX, double mouseY, boolean isInstant)
      Processes held mouse input on the quantity selection screen.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
      isInstant - Whether the input will trigger an instant change.
    • onClose

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

      protected void sendBuyPacket()
      Sends a packet to the server when buying an item.
    • sendSellPacket

      protected void sendSellPacket()
      Sends a packet to the server when selling an item.
    • renderBuyScreen

      protected void renderBuyScreen(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY)
    • renderMenu

      protected void renderMenu(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY)
      Renders the list of items displayed in the current tab.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
    • isPauseScreen

      public boolean isPauseScreen()
      Overrides:
      isPauseScreen in class net.minecraft.client.gui.screens.Screen
    • renderDirtBackground

      public void renderDirtBackground(net.minecraft.client.gui.GuiGraphics p_282281_)
      Overrides:
      renderDirtBackground in class net.minecraft.client.gui.screens.Screen
    • renderBackground

      public void renderBackground(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks)
      Overrides:
      renderBackground in class net.minecraft.client.gui.screens.Screen