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:
AbstractFurnaceScreen,BeaconScreen,BrewingStandScreen,CartographyTableScreen,ContainerScreen,ContainerTypeTest.TestGui,CrafterScreen,CraftingScreen,DispenserScreen,EffectRenderingInventoryScreen,EnchantmentScreen,GrindstoneScreen,HopperScreen,HorseInventoryScreen,ItemCombinerScreen,LoomScreen,MerchantScreen,RecipeBookTestScreen,ShulkerBoxScreen,StonecutterScreen
public abstract class AbstractContainerScreen<T extends AbstractContainerMenu>
extends Screen
implements MenuAccess<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Slotprivate booleanprivate ItemStackprivate static final intprotected Slotprotected intprotected intstatic final ResourceLocationprotected intprotected intprotected booleanprivate booleanprivate intprivate Slotprivate longprivate ItemStackprotected intprotected final Tprotected final Componentprivate intprivate intprivate intprivate static final intprivate Slotprivate longprivate booleanstatic final intprotected intprivate static final floatprivate Slotprivate ItemStackprivate intprivate intprivate longprotected intprotected intprotected intFields inherited from class net.minecraft.client.gui.screens.Screen
CUBE_MAP, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, PANORAMA, renderables, screenExecutor, title, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckHotbarKeyPressed(int p_97806_, int p_97807_) private voidcheckHotbarMouseClicked(int p_97763_) voidprotected voidprivate SlotfindSlot(double p_97745_, double p_97746_) intintgetMenu()intgetSlotColor(int index) @Nullable SlotgetTooltipFromContainerItem(ItemStack p_283689_) intgetXSize()intgetYSize()protected voidhandleSlotStateChanged(int p_307539_, int p_307621_, boolean p_307388_) protected booleanhasClickedOutside(double p_97757_, double p_97758_, int p_97759_, int p_97760_, int p_97761_) protected voidinit()protected booleanisHovering(int p_97768_, int p_97769_, int p_97770_, int p_97771_, double p_97772_, double p_97773_) private booleanisHovering(Slot p_97775_, double p_97776_, double p_97777_) booleanbooleankeyPressed(int p_97765_, int p_97766_, int p_97767_) booleanmouseClicked(double p_97748_, double p_97749_, int p_97750_) booleanmouseDragged(double p_97752_, double p_97753_, int p_97754_, double p_97755_, double p_97756_) booleanmouseReleased(double p_97812_, double p_97813_, int p_97814_) voidonClose()private voidvoidremoved()voidrender(GuiGraphics p_283479_, int p_283661_, int p_281248_, float p_281886_) Neo: mixins targeting this method won't fire for container screens asrender(net.minecraft.client.gui.GuiGraphics, int, int, float)replicates this method in place of a super call to insert an eventvoidrenderBackground(GuiGraphics p_295206_, int p_295457_, int p_294596_, float p_296351_) protected abstract voidrenderBg(GuiGraphics p_283065_, float p_97788_, int p_97789_, int p_97790_) private voidrenderFloatingItem(GuiGraphics p_282567_, ItemStack p_281330_, int p_281772_, int p_281689_, String p_282568_) protected voidrenderLabels(GuiGraphics p_281635_, int p_282681_, int p_283686_) protected voidrenderSlot(GuiGraphics p_281607_, Slot p_282613_) protected voidrenderSlotContents(GuiGraphics guiGraphics, ItemStack itemstack, Slot slot, String countString) static voidrenderSlotHighlight(GuiGraphics p_283692_, int p_281453_, int p_281915_, int p_283504_) static voidrenderSlotHighlight(GuiGraphics p_283692_, int p_281453_, int p_281915_, int p_283504_, int color) protected voidrenderSlotHighlight(GuiGraphics guiGraphics, Slot slot, int mouseX, int mouseY, float partialTick) Renders a highlight for the given slot to indicate the mouse is currently hovering over it.protected voidrenderTooltip(GuiGraphics p_283594_, int p_282171_, int p_281909_) protected voidslotClicked(Slot p_97778_, int p_97779_, int p_97780_, ClickType p_97781_) final voidtick()Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, onFilesDrop, rebuildWidgets, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, resize, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
INVENTORY_LOCATION
-
SNAPBACK_SPEED
private static final float SNAPBACK_SPEED- See Also:
-
QUICKDROP_DELAY
private static final int QUICKDROP_DELAY- See Also:
-
SLOT_ITEM_BLIT_OFFSET
public static final int SLOT_ITEM_BLIT_OFFSET- See Also:
-
HOVER_ITEM_BLIT_OFFSET
private static final int HOVER_ITEM_BLIT_OFFSET- See Also:
-
imageWidth
protected int imageWidth -
imageHeight
protected int imageHeight -
titleLabelX
protected int titleLabelX -
titleLabelY
protected int titleLabelY -
inventoryLabelX
protected int inventoryLabelX -
inventoryLabelY
protected int inventoryLabelY -
playerInventoryTitle
-
hoveredSlot
-
clickedSlot
-
snapbackEnd
-
quickdropSlot
-
lastClickSlot
-
leftPos
protected int leftPos -
topPos
protected int topPos -
isSplittingStack
private boolean isSplittingStack -
draggingItem
-
snapbackStartX
private int snapbackStartX -
snapbackStartY
private int snapbackStartY -
snapbackTime
private long snapbackTime -
snapbackItem
-
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 -
lastClickTime
private long lastClickTime -
lastClickButton
private int lastClickButton -
doubleclick
private boolean doubleclick -
lastQuickMoved
-
slotColor
protected int slotColor
-
-
Constructor Details
-
AbstractContainerScreen
-
-
Method Details
-
init
protected void init() -
render
Description copied from class:ScreenNeo: mixins targeting this method won't fire for container screens asrender(net.minecraft.client.gui.GuiGraphics, int, int, float)replicates this method in place of a super call to insert an event- Specified by:
renderin interfaceRenderable- Overrides:
renderin classScreen
-
renderBackground
- Overrides:
renderBackgroundin classScreen
-
renderSlotHighlight
public static void renderSlotHighlight(GuiGraphics p_283692_, int p_281453_, int p_281915_, int p_283504_) -
renderSlotHighlight
public static void renderSlotHighlight(GuiGraphics p_283692_, int p_281453_, int p_281915_, int p_283504_, int color) -
renderSlotHighlight
protected void renderSlotHighlight(GuiGraphics guiGraphics, Slot slot, int mouseX, int mouseY, float partialTick) Renders a highlight for the given slot to indicate the mouse is currently hovering over it. -
renderTooltip
-
getTooltipFromContainerItem
-
renderFloatingItem
private void renderFloatingItem(GuiGraphics p_282567_, ItemStack p_281330_, int p_281772_, int p_281689_, String p_282568_) -
renderLabels
-
renderBg
-
renderSlot
-
renderSlotContents
protected void renderSlotContents(GuiGraphics guiGraphics, ItemStack itemstack, Slot slot, @Nullable String countString) -
recalculateQuickCraftRemaining
private void recalculateQuickCraftRemaining() -
findSlot
-
mouseClicked
public boolean mouseClicked(double p_97748_, double p_97749_, int p_97750_) - Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener
-
checkHotbarMouseClicked
private void checkHotbarMouseClicked(int p_97763_) -
hasClickedOutside
protected boolean hasClickedOutside(double p_97757_, double p_97758_, int p_97759_, int p_97760_, int p_97761_) -
mouseDragged
public boolean mouseDragged(double p_97752_, double p_97753_, int p_97754_, double p_97755_, double p_97756_) - Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener
-
mouseReleased
public boolean mouseReleased(double p_97812_, double p_97813_, int p_97814_) - Specified by:
mouseReleasedin interfaceContainerEventHandler- Specified by:
mouseReleasedin interfaceGuiEventListener
-
clearDraggingState
public void clearDraggingState() -
isHovering
-
isHovering
protected boolean isHovering(int p_97768_, int p_97769_, int p_97770_, int p_97771_, double p_97772_, double p_97773_) -
slotClicked
-
handleSlotStateChanged
protected void handleSlotStateChanged(int p_307539_, int p_307621_, boolean p_307388_) -
keyPressed
public boolean keyPressed(int p_97765_, int p_97766_, int p_97767_) - Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classScreen
-
checkHotbarKeyPressed
protected boolean checkHotbarKeyPressed(int p_97806_, int p_97807_) -
removed
public void removed() -
isPauseScreen
public boolean isPauseScreen()- Overrides:
isPauseScreenin classScreen
-
tick
public final void tick() -
containerTick
protected void containerTick() -
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
public void onClose()
-