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
Modifier and TypeFieldDescriptionprotected 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 int
The index that is currently scrolled to in the sell tab.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
ModifierConstructorDescriptionprotected
AbstractShopScreen
(List<ShopItem> shopItems, boolean sellable) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
onClose()
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
-
sellItems
-
buyItems
-
sellable
protected boolean sellable -
selectedItem
protected int selectedItemThe index of the currently selected item. -
quantity
protected int quantityThe buy/sell quantity of the currently selected item. -
floatQuantity
protected float floatQuantityThe buy/sell quantity of the selected item in float. -
buyStartIndex
protected int buyStartIndexThe index that is currently scrolled to in the buy tab. -
sellStartIndex
protected int sellStartIndexThe index that is currently scrolled to in the sell tab. -
currentTab
-
-
Constructor Details
-
AbstractShopScreen
-
-
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 classnet.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 classnet.minecraft.client.gui.screens.Screen
-
renderDirtBackground
public void renderDirtBackground(net.minecraft.client.gui.GuiGraphics p_282281_) - Overrides:
renderDirtBackground
in classnet.minecraft.client.gui.screens.Screen
-
renderBackground
public void renderBackground(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) - Overrides:
renderBackground
in classnet.minecraft.client.gui.screens.Screen
-