Class AbstractContainerScreen<T extends AbstractContainerMenu>
java.lang.Object
net.minecraft.client.gui.GuiComponent
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
,CraftingScreen
,DispenserScreen
,EffectRenderingInventoryScreen
,EnchantmentScreen
,GrindstoneScreen
,HopperScreen
,HorseInventoryScreen
,ItemCombinerScreen
,LoomScreen
,MerchantScreen
,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
Modifier and TypeFieldDescriptionprivate Slot
private boolean
private ItemStack
private static final int
protected Slot
protected int
protected int
static final ResourceLocation
protected int
protected int
protected boolean
private boolean
private int
private Slot
private long
private ItemStack
protected int
protected final T
protected final Component
private int
private int
private int
private static final int
private Slot
private long
private boolean
static final int
protected int
private static final float
private Slot
private ItemStack
private int
private int
private long
protected int
protected int
protected int
Fields inherited from class net.minecraft.client.gui.screens.Screen
font, height, itemRenderer, minecraft, passEvents, renderables, title, width
Fields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, LIGHT_DIRT_BACKGROUND, STATS_ICON_LOCATION
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkHotbarKeyPressed
(int p_97806_, int p_97807_) private void
checkHotbarMouseClicked
(int p_97763_) void
protected void
private Slot
findSlot
(double p_97745_, double p_97746_) int
int
getMenu()
int
getSlotColor
(int index) @Nullable Slot
int
getXSize()
int
getYSize()
protected boolean
hasClickedOutside
(double p_97757_, double p_97758_, int p_97759_, int p_97760_, int p_97761_) protected void
init()
protected boolean
isHovering
(int p_97768_, int p_97769_, int p_97770_, int p_97771_, double p_97772_, double p_97773_) private boolean
isHovering
(Slot p_97775_, double p_97776_, double p_97777_) boolean
boolean
keyPressed
(int p_97765_, int p_97766_, int p_97767_) boolean
mouseClicked
(double p_97748_, double p_97749_, int p_97750_) boolean
mouseDragged
(double p_97752_, double p_97753_, int p_97754_, double p_97755_, double p_97756_) boolean
mouseReleased
(double p_97812_, double p_97813_, int p_97814_) void
onClose()
private void
void
removed()
void
protected abstract void
private void
renderFloatingItem
(PoseStack p_275498_, ItemStack p_275341_, int p_275289_, int p_275690_, String p_275201_) protected void
renderLabels
(PoseStack p_97808_, int p_97809_, int p_97810_) private void
renderSlot
(PoseStack p_97800_, Slot p_97801_) static void
renderSlotHighlight
(PoseStack p_169607_, int p_169608_, int p_169609_, int p_169610_) static void
renderSlotHighlight
(PoseStack p_169607_, int p_169608_, int p_169609_, int p_169610_, int slotColor) protected void
renderTooltip
(PoseStack p_97791_, int p_97792_, int p_97793_) protected void
slotClicked
(Slot p_97778_, int p_97779_, int p_97780_, ClickType p_97781_) final void
tick()
Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearWidgets, findNarratableWidget, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, hideWidgets, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrationEnabled, onFilesDrop, rebuildWidgets, removeWidget, renderBackground, renderComponentHoverEffect, renderComponentTooltip, renderComponentTooltip, renderComponentTooltip, renderComponentTooltip, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderTooltip, renderTooltip, renderTooltip, renderTooltip, renderTooltip, renderWithTooltip, repositionElements, resize, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, wrapScreenError
Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocused
Methods inherited from class net.minecraft.client.gui.GuiComponent
blit, blit, blit, blit, blit, blit, blitNineSliced, blitNineSliced, blitNineSliced, blitOutlineBlack, blitRepeating, disableScissor, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, enableScissor, fill, fill, fillGradient, fillGradient, fillGradient, hLine, renderOutline, vLine
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, mouseScrolled, 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
-
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
- Specified by:
render
in interfaceRenderable
- Overrides:
render
in classScreen
-
renderSlotHighlight
public static void renderSlotHighlight(PoseStack p_169607_, int p_169608_, int p_169609_, int p_169610_) -
renderSlotHighlight
public static void renderSlotHighlight(PoseStack p_169607_, int p_169608_, int p_169609_, int p_169610_, int slotColor) -
renderTooltip
-
renderFloatingItem
-
renderLabels
-
renderBg
-
renderSlot
-
recalculateQuickCraftRemaining
private void recalculateQuickCraftRemaining() -
findSlot
-
mouseClicked
public boolean mouseClicked(double p_97748_, double p_97749_, int p_97750_) - Specified by:
mouseClicked
in interfaceContainerEventHandler
- Specified by:
mouseClicked
in 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:
mouseDragged
in interfaceContainerEventHandler
- Specified by:
mouseDragged
in interfaceGuiEventListener
-
mouseReleased
public boolean mouseReleased(double p_97812_, double p_97813_, int p_97814_) - Specified by:
mouseReleased
in interfaceContainerEventHandler
- Specified by:
mouseReleased
in 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
-
keyPressed
public boolean keyPressed(int p_97765_, int p_97766_, int p_97767_) - Specified by:
keyPressed
in interfaceContainerEventHandler
- Specified by:
keyPressed
in interfaceGuiEventListener
- Overrides:
keyPressed
in classScreen
-
checkHotbarKeyPressed
protected boolean checkHotbarKeyPressed(int p_97806_, int p_97807_) -
removed
public void removed() -
isPauseScreen
public boolean isPauseScreen()- Overrides:
isPauseScreen
in classScreen
-
tick
public final void tick() -
containerTick
protected void containerTick() -
getMenu
- Specified by:
getMenu
in 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()
-