Class MerchantScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<MerchantMenu>
net.minecraft.client.gui.screens.inventory.MerchantScreen
- All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, MenuAccess<MerchantMenu>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final Componentprivate static final Identifierprivate static final Identifierprivate static final Identifierprivate static final Identifierprivate booleanprivate static final intprivate static final intprivate static final intprivate static final Identifierprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final Identifierprivate static final intprivate static final Identifierprivate static final intprivate intprivate static final intprivate static final intprivate intThe integer value corresponding to the currently selected merchant recipe.private static final intprivate static final intprivate static final Identifierprivate static final Identifierprivate static final intprivate static final intprivate static final intprivate final MerchantScreen.TradeOfferButton[]private static final Componentprivate static final IdentifierThe GUI texture for the villager merchant GUI.Fields inherited from class AbstractContainerScreen
BACKGROUND_TEXTURE_HEIGHT, BACKGROUND_TEXTURE_WIDTH, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, hoveredSlot, imageHeight, imageWidth, INVENTORY_LOCATION, inventoryLabelX, inventoryLabelY, isQuickCrafting, leftPos, menu, playerInventoryTitle, quickCraftSlots, slotColor, titleLabelX, titleLabelY, topPosFields inherited from class Screen
FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, width -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleancanScroll(int numberOfOffers) protected voidinit()booleanmouseClicked(MouseButtonEvent event, boolean doubleClick) booleanmouseDragged(MouseButtonEvent event, double dx, double dy) booleanmouseReleased(MouseButtonEvent event) booleanmouseScrolled(double x, double y, double scrollX, double scrollY) private voidprivate voidrenderAndDecorateCostA(GuiGraphics graphics, ItemStack costA, ItemStack baseCostA, int sellItem1X, int decorHeight) protected voidrenderBg(GuiGraphics graphics, float a, int xm, int ym) private voidrenderButtonArrows(GuiGraphics graphics, MerchantOffer offer, int xo, int decorHeight) voidrenderContents(GuiGraphics graphics, int mouseX, int mouseY, float a) protected voidrenderLabels(GuiGraphics graphics, int xm, int ym) private voidrenderProgressBar(GuiGraphics graphics, int xo, int yo, MerchantOffer offer) private voidrenderScroller(GuiGraphics graphics, int xo, int yo, int mouseX, int mouseY, MerchantOffers offers) Methods inherited from class AbstractContainerScreen
addItemSlotMouseAction, checkHotbarKeyPressed, clearDraggingState, containerTick, getGuiLeft, getGuiTop, getMenu, getSlotColor, getSlotUnderMouse, getTooltipFromContainerItem, getXSize, getYSize, handleSlotStateChanged, hasClickedOutside, isHovering, isInGameUi, isPauseScreen, keyPressed, onClose, onMouseClickAction, removed, render, renderBackground, renderCarriedItem, renderSlot, renderSlotContents, renderSlots, renderSnapbackItem, renderTooltip, slotClicked, tickMethods inherited from class Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isMouseOver, isValidCharacterForName, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltipAndSubtitles, repositionElements, resize, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatusMethods inherited from class AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContainerEventHandler
charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyReleased, nextFocusPath, setFocusedMethods inherited from interface GuiEventListener
mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
OUT_OF_STOCK_SPRITE
-
EXPERIENCE_BAR_BACKGROUND_SPRITE
-
EXPERIENCE_BAR_CURRENT_SPRITE
-
EXPERIENCE_BAR_RESULT_SPRITE
-
SCROLLER_SPRITE
-
SCROLLER_DISABLED_SPRITE
-
TRADE_ARROW_OUT_OF_STOCK_SPRITE
-
TRADE_ARROW_SPRITE
-
DISCOUNT_STRIKETHRUOGH_SPRITE
-
VILLAGER_LOCATION
The GUI texture for the villager merchant GUI. -
TEXTURE_WIDTH
private static final int TEXTURE_WIDTH- See Also:
-
TEXTURE_HEIGHT
private static final int TEXTURE_HEIGHT- See Also:
-
MERCHANT_MENU_PART_X
private static final int MERCHANT_MENU_PART_X- See Also:
-
PROGRESS_BAR_X
private static final int PROGRESS_BAR_X- See Also:
-
PROGRESS_BAR_Y
private static final int PROGRESS_BAR_Y- See Also:
-
SELL_ITEM_1_X
private static final int SELL_ITEM_1_X- See Also:
-
SELL_ITEM_2_X
private static final int SELL_ITEM_2_X- See Also:
-
BUY_ITEM_X
private static final int BUY_ITEM_X- See Also:
-
LABEL_Y
private static final int LABEL_Y- See Also:
-
NUMBER_OF_OFFER_BUTTONS
private static final int NUMBER_OF_OFFER_BUTTONS- See Also:
-
TRADE_BUTTON_X
private static final int TRADE_BUTTON_X- See Also:
-
TRADE_BUTTON_HEIGHT
private static final int TRADE_BUTTON_HEIGHT- See Also:
-
TRADE_BUTTON_WIDTH
private static final int TRADE_BUTTON_WIDTH- See Also:
-
SCROLLER_HEIGHT
private static final int SCROLLER_HEIGHT- See Also:
-
SCROLLER_WIDTH
private static final int SCROLLER_WIDTH- See Also:
-
SCROLL_BAR_HEIGHT
private static final int SCROLL_BAR_HEIGHT- See Also:
-
SCROLL_BAR_TOP_POS_Y
private static final int SCROLL_BAR_TOP_POS_Y- See Also:
-
SCROLL_BAR_START_X
private static final int SCROLL_BAR_START_X- See Also:
-
TRADES_LABEL
-
DEPRECATED_TOOLTIP
-
shopItem
private int shopItemThe integer value corresponding to the currently selected merchant recipe. -
tradeOfferButtons
-
scrollOff
private int scrollOff -
isDragging
private boolean isDragging
-
-
Constructor Details
-
MerchantScreen
-
-
Method Details
-
postButtonClick
private void postButtonClick() -
init
protected void init()- Overrides:
initin classAbstractContainerScreen<MerchantMenu>
-
renderLabels
- Overrides:
renderLabelsin classAbstractContainerScreen<MerchantMenu>
-
renderBg
- Specified by:
renderBgin classAbstractContainerScreen<MerchantMenu>
-
renderProgressBar
-
renderScroller
private void renderScroller(GuiGraphics graphics, int xo, int yo, int mouseX, int mouseY, MerchantOffers offers) -
renderContents
- Overrides:
renderContentsin classAbstractContainerScreen<MerchantMenu>
-
renderButtonArrows
-
renderAndDecorateCostA
private void renderAndDecorateCostA(GuiGraphics graphics, ItemStack costA, ItemStack baseCostA, int sellItem1X, int decorHeight) -
canScroll
private boolean canScroll(int numberOfOffers) -
mouseScrolled
public boolean mouseScrolled(double x, double y, double scrollX, double scrollY) - Specified by:
mouseScrolledin interfaceContainerEventHandler- Specified by:
mouseScrolledin interfaceGuiEventListener- Overrides:
mouseScrolledin classAbstractContainerScreen<MerchantMenu>
-
mouseDragged
- Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener- Overrides:
mouseDraggedin classAbstractContainerScreen<MerchantMenu>
-
mouseClicked
- Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener- Overrides:
mouseClickedin classAbstractContainerScreen<MerchantMenu>
-
mouseReleased
- Specified by:
mouseReleasedin interfaceContainerEventHandler- Specified by:
mouseReleasedin interfaceGuiEventListener- Overrides:
mouseReleasedin classAbstractContainerScreen<MerchantMenu>
-