public abstract class AbstractShopScreen
extends net.minecraft.client.gui.screen.Screen
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowMultiple
Whether to allow multiple objects to be affected by a transaction at once.
|
static java.util.ArrayList<ClientShopItem> |
buyItems
Items that can be bought from the shop.
|
protected int |
buyStartIndex
The index that is currently scrolled to in the buy tab.
|
protected float |
floatQuantity
The buy/sell quantity of the selected item in float.
|
protected int |
quantity
The buy/sell quantity of the currently selected item.
|
protected int |
selectedItem
The index of the currently selected item.
|
static java.util.ArrayList<ClientShopItem> |
sellItems
Items that can be sold to the shop.
|
protected int |
sellStartIndex
The index that is currently scrolled to in the sell tab.
|
Constructor and Description |
---|
AbstractShopScreen()
Initializes the container.
|
Modifier and Type | Method and 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)
Handles mouse input on the buy screen.
|
protected boolean |
isBuyMiniScreenVisible()
Checks if the side box containing the selected item is visible.
|
boolean |
isPauseScreen()
Returns true if this GUI should pause the game when it is displayed in single-player
|
boolean |
mouseScrolled(double mouseX,
double mouseY,
double delta) |
void |
onClose()
Closes the shop screen.
|
void |
renderBackground(com.mojang.blaze3d.matrix.MatrixStack matrix) |
void |
renderBackground(com.mojang.blaze3d.matrix.MatrixStack matrix,
int v) |
protected void |
renderBuyScreen(com.mojang.blaze3d.matrix.MatrixStack matrix,
int mouseX,
int mouseY)
Renders the GUI for choosing items to buy or sell.
|
void |
renderDirtBackground(int v) |
protected void |
renderMenu(com.mojang.blaze3d.matrix.MatrixStack matrix,
int mouseX,
int mouseY)
Renders the list of items displayed in the current tab.
|
protected void |
sendBuyPacket()
Sends a packet to the server when buying an item.
|
protected void |
sendSellPacket()
Sends a packet to the server when selling an item.
|
void |
tick() |
addButton, addWidget, children, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, hasAltDown, hasControlDown, hasShiftDown, init, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, keyPressed, onFilesDrop, removed, render, renderComponentHoverEffect, renderComponentTooltip, renderTooltip, renderTooltip, renderTooltip, renderToolTip, renderWrappedToolTip, resize, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenError
getFocused, isDragging, setDragging, setFocused
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static java.util.ArrayList<ClientShopItem> buyItems
public static java.util.ArrayList<ClientShopItem> sellItems
protected int selectedItem
protected int quantity
protected float floatQuantity
protected int buyStartIndex
protected int sellStartIndex
protected boolean allowMultiple
public void tick()
tick
in interface net.minecraft.client.gui.screen.IScreen
tick
in class net.minecraft.client.gui.screen.Screen
public boolean isPauseScreen()
isPauseScreen
in class net.minecraft.client.gui.screen.Screen
public boolean mouseScrolled(double mouseX, double mouseY, double delta)
protected boolean isBuyMiniScreenVisible()
public void renderDirtBackground(int v)
renderDirtBackground
in class net.minecraft.client.gui.screen.Screen
public void renderBackground(com.mojang.blaze3d.matrix.MatrixStack matrix)
renderBackground
in class net.minecraft.client.gui.screen.Screen
public void renderBackground(com.mojang.blaze3d.matrix.MatrixStack matrix, int v)
renderBackground
in class net.minecraft.client.gui.screen.Screen
protected void clickBuyScreen(double mouseX, double mouseY)
mouseX
- The x coordinate of the mouse.mouseY
- The y coordinate of the mouse.protected void clickBuyMiniScreen(double mouseX, double mouseY, boolean isInstant)
mouseX
- The x coordinate of the mouse.mouseY
- The y coordinate of the mouse.isInstant
- Whether the input will trigger an instant change.public void onClose()
onClose
in class net.minecraft.client.gui.screen.Screen
protected void sendBuyPacket()
protected void sendSellPacket()
protected void renderBuyScreen(com.mojang.blaze3d.matrix.MatrixStack matrix, int mouseX, int mouseY)
mouseX
- The x coordinate of the mouse.mouseY
- The y coordinate of the mouse.protected void renderMenu(com.mojang.blaze3d.matrix.MatrixStack matrix, int mouseX, int mouseY)
mouseX
- The x coordinate of the mouse.mouseY
- The y coordinate of the mouse.