Class AbstractContainerScreen<T extends AbstractContainerMenu>
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T>
- All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, MenuAccess<T>
- Direct Known Subclasses:
AbstractMountInventoryScreen, AbstractRecipeBookScreen, BeaconScreen, BrewingStandScreen, CartographyTableScreen, ContainerScreen, CrafterScreen, CreativeModeInventoryScreen, DispenserScreen, EnchantmentScreen, GrindstoneScreen, HopperScreen, ItemCombinerScreen, LoomScreen, MerchantScreen, ShulkerBoxScreen, StonecutterScreen
public abstract class AbstractContainerScreen<T extends AbstractContainerMenu>
extends Screen
implements MenuAccess<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordNested classes/interfaces inherited from class Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprivate @Nullable Slotprotected static final intprotected static final intprivate booleanprivate ItemStackprotected @Nullable Slotprotected final intprotected final intstatic final Identifierprotected intprotected intprotected booleanprivate booleanprivate final List<ItemSlotMouseAction> private @Nullable Slotprivate ItemStackprotected intprotected final Tprotected final Componentprivate intprivate intprivate intprivate static final intprivate @Nullable Slotprivate longprivate booleanprivate static final Identifierprivate static final Identifierprotected intprivate static final floatprivate @Nullable AbstractContainerScreen.SnapbackDataprotected intprotected intprotected intFields 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
ConstructorsConstructorDescriptionAbstractContainerScreen(T menu, Inventory inventory, Component title) AbstractContainerScreen(T menu, Inventory inventory, Component title, int imageWidth, int imageHeight) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddItemSlotMouseAction(ItemSlotMouseAction itemSlotMouseAction) protected booleancheckHotbarKeyPressed(KeyEvent event) private voidvoidprotected voidvoidextractCarriedItem(GuiGraphicsExtractor graphics, int mouseX, int mouseY) voidextractContents(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) private voidextractFloatingItem(GuiGraphicsExtractor graphics, ItemStack carried, int x, int y, @Nullable String itemCount) protected voidextractLabels(GuiGraphicsExtractor graphics, int xm, int ym) voidextractRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) protected voidextractSlot(GuiGraphicsExtractor graphics, Slot slot, int mouseX, int mouseY) private voidextractSlotHighlightBack(GuiGraphicsExtractor graphics) private voidprotected voidextractSlots(GuiGraphicsExtractor graphics, int mouseX, int mouseY) voidextractSnapbackItem(GuiGraphicsExtractor graphics) protected voidextractTooltip(GuiGraphicsExtractor graphics, int mouseX, int mouseY) intintprivate @Nullable SlotgetHoveredSlot(double x, double y) getMenu()intgetSlotColor(int index) @Nullable SlotgetTooltipFromContainerItem(ItemStack itemStack) intgetXSize()intgetYSize()protected voidhandleSlotStateChanged(int slotId, int containerId, boolean newState) protected booleanhasClickedOutside(double mx, double my, int xo, int yo) protected voidinit()protected booleanisHovering(int left, int top, int w, int h, double xm, double ym) private booleanisHovering(Slot slot, double xm, double ym) booleanbooleanbooleankeyPressed(KeyEvent event) booleanmouseClicked(MouseButtonEvent event, boolean doubleClick) booleanmouseDragged(MouseButtonEvent event, double dx, double dy) booleanmouseReleased(MouseButtonEvent event) booleanmouseScrolled(double x, double y, double scrollX, double scrollY) voidonClose()(package private) voidonMouseClickAction(@Nullable Slot slot, ContainerInput containerInput) private voidonStopHovering(Slot slot) private voidprivate voidvoidremoved()protected voidrenderSlotContents(GuiGraphicsExtractor graphics, ItemStack itemStack, Slot slot, @Nullable String itemCount) private booleanshouldAddSlotToQuickCraft(Slot slot, ItemStack carried) private booleanprotected voidslotClicked(Slot slot, int slotId, int buttonNum, ContainerInput containerInput) final voidtick()Methods inherited from class Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, extractBackground, extractBlurredBackground, extractMenuBackground, extractMenuBackground, extractMenuBackgroundTexture, extractPanorama, extractRenderStateWithTooltipAndSubtitles, extractTransparentBackground, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isMouseOver, isValidCharacterForName, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removeWidget, 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, preeditUpdated, setFocusedMethods inherited from interface GuiEventListener
mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
INVENTORY_LOCATION
-
SLOT_HIGHLIGHT_BACK_SPRITE
-
SLOT_HIGHLIGHT_FRONT_SPRITE
-
BACKGROUND_TEXTURE_WIDTH
protected static final int BACKGROUND_TEXTURE_WIDTH- See Also:
-
BACKGROUND_TEXTURE_HEIGHT
protected static final int BACKGROUND_TEXTURE_HEIGHT- See Also:
-
SNAPBACK_SPEED
private static final float SNAPBACK_SPEED- See Also:
-
QUICKDROP_DELAY
private static final int QUICKDROP_DELAY- See Also:
-
DEFAULT_IMAGE_WIDTH
protected static final int DEFAULT_IMAGE_WIDTH- See Also:
-
DEFAULT_IMAGE_HEIGHT
protected static final int DEFAULT_IMAGE_HEIGHT- See Also:
-
imageWidth
protected final int imageWidth -
imageHeight
protected final int imageHeight -
titleLabelX
protected int titleLabelX -
titleLabelY
protected int titleLabelY -
inventoryLabelX
protected int inventoryLabelX -
inventoryLabelY
protected int inventoryLabelY -
itemSlotMouseActions
-
playerInventoryTitle
-
hoveredSlot
-
clickedSlot
-
quickdropSlot
-
lastClickSlot
-
snapbackData
-
leftPos
protected int leftPos -
topPos
protected int topPos -
isSplittingStack
private boolean isSplittingStack -
draggingItem
-
quickdropTime
private long quickdropTime -
quickCraftSlots
-
isQuickCrafting
protected boolean isQuickCrafting -
quickCraftingType
private int quickCraftingType -
quickCraftingButton
private int quickCraftingButton -
skipNextRelease
private boolean skipNextRelease -
quickCraftingRemainder
private int quickCraftingRemainder -
doubleclick
private boolean doubleclick -
lastQuickMoved
-
slotColor
protected int slotColor
-
-
Constructor Details
-
AbstractContainerScreen
-
AbstractContainerScreen
-
-
Method Details
-
init
-
addItemSlotMouseAction
-
extractRenderState
- Specified by:
extractRenderStatein interfaceRenderable- Overrides:
extractRenderStatein classScreen
-
extractContents
-
extractCarriedItem
-
extractSnapbackItem
-
extractSlots
-
mouseScrolled
public boolean mouseScrolled(double x, double y, double scrollX, double scrollY) - Specified by:
mouseScrolledin interfaceContainerEventHandler- Specified by:
mouseScrolledin interfaceGuiEventListener
-
extractSlotHighlightBack
-
extractSlotHighlightFront
-
extractTooltip
-
showTooltipWithItemInHand
-
getTooltipFromContainerItem
-
extractFloatingItem
private void extractFloatingItem(GuiGraphicsExtractor graphics, ItemStack carried, int x, int y, @Nullable String itemCount) -
extractLabels
-
extractSlot
-
renderSlotContents
protected void renderSlotContents(GuiGraphicsExtractor graphics, ItemStack itemStack, Slot slot, @Nullable String itemCount) -
recalculateQuickCraftRemaining
private void recalculateQuickCraftRemaining() -
getHoveredSlot
-
mouseClicked
- Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener
-
checkHotbarMouseClicked
-
hasClickedOutside
protected boolean hasClickedOutside(double mx, double my, int xo, int yo) -
mouseDragged
- Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceContainerEventHandler- Specified by:
mouseReleasedin interfaceGuiEventListener
-
clearDraggingState
public void clearDraggingState() -
isHovering
-
isHovering
protected boolean isHovering(int left, int top, int w, int h, double xm, double ym) -
onStopHovering
-
slotClicked
-
onMouseClickAction
-
handleSlotStateChanged
protected void handleSlotStateChanged(int slotId, int containerId, boolean newState) -
keyPressed
- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classScreen
-
checkHotbarKeyPressed
-
removed
-
isPauseScreen
public boolean isPauseScreen()- Overrides:
isPauseScreenin classScreen
-
isInGameUi
public boolean isInGameUi()- Overrides:
isInGameUiin classScreen
-
tick
-
containerTick
protected void containerTick() -
shouldAddSlotToQuickCraft
-
quickCraftToSlots
private void quickCraftToSlots() -
getMenu
- Specified by:
getMenuin interfaceMenuAccess<T extends AbstractContainerMenu>
-
getSlotUnderMouse
-
getGuiLeft
public int getGuiLeft() -
getGuiTop
public int getGuiTop() -
getXSize
public int getXSize() -
getYSize
public int getYSize() -
getSlotColor
public int getSlotColor(int index) -
onClose
-