Class ContainerScreen<T extends Container>
java.lang.Object
net.minecraft.client.gui.AbstractGui
net.minecraft.client.gui.FocusableGui
net.minecraft.client.gui.screen.Screen
net.minecraft.client.gui.screen.inventory.ContainerScreen<T>
- All Implemented Interfaces:
IGuiEventListener
,IHasContainer<T>
,INestedGuiEventHandler
,IRenderable
,IScreen
- Direct Known Subclasses:
AbstractFurnaceScreen
,AbstractRepairScreen
,BeaconScreen
,BrewingStandScreen
,CartographyTableScreen
,ChestScreen
,ContainerTypeTest.TestGui
,CraftingScreen
,DispenserScreen
,DisplayEffectsScreen
,EnchantmentScreen
,GrindstoneScreen
,HopperScreen
,HorseInventoryScreen
,LoomScreen
,MerchantScreen
,ShulkerBoxScreen
,StonecutterScreen
public abstract class ContainerScreen<T extends Container>
extends Screen
implements IHasContainer<T>
-
Field Summary
Modifier and TypeFieldDescriptionprivate Slot
private boolean
private ItemStack
protected Slot
protected int
protected int
protected final PlayerInventory
static final ResourceLocation
protected int
protected int
protected boolean
private boolean
private int
private Slot
private long
private ItemStack
protected int
protected final T
private int
private int
private int
private Slot
private long
private boolean
protected int
private Slot
private ItemStack
private int
private int
private long
protected int
protected int
protected int
Fields inherited from class net.minecraft.client.gui.screen.Screen
buttons, children, font, height, itemRenderer, minecraft, passEvents, title, width
Fields inherited from class net.minecraft.client.gui.AbstractGui
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
-
Constructor Summary
ConstructorDescriptionContainerScreen
(T p_i51105_1_, PlayerInventory p_i51105_2_, ITextComponent p_i51105_3_) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkHotbarKeyPressed
(int p_195363_1_, int p_195363_2_) private void
checkHotbarMouseClicked
(int p_241609_1_) private Slot
findSlot
(double p_195360_1_, double p_195360_3_) int
int
getMenu()
int
getSlotColor
(int index) int
getXSize()
int
getYSize()
protected boolean
hasClickedOutside
(double p_195361_1_, double p_195361_3_, int p_195361_5_, int p_195361_6_, int p_195361_7_) protected void
init()
protected boolean
isHovering
(int p_195359_1_, int p_195359_2_, int p_195359_3_, int p_195359_4_, double p_195359_5_, double p_195359_7_) private boolean
isHovering
(Slot p_195362_1_, double p_195362_2_, double p_195362_4_) boolean
boolean
keyPressed
(int p_231046_1_, int p_231046_2_, int p_231046_3_) boolean
mouseClicked
(double p_231044_1_, double p_231044_3_, int p_231044_5_) boolean
mouseDragged
(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_) boolean
mouseReleased
(double p_231048_1_, double p_231048_3_, int p_231048_5_) void
onClose()
private void
void
removed()
void
render
(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_) protected abstract void
renderBg
(MatrixStack p_230450_1_, float p_230450_2_, int p_230450_3_, int p_230450_4_) private void
renderFloatingItem
(ItemStack p_146982_1_, int p_146982_2_, int p_146982_3_, String p_146982_4_) protected void
renderLabels
(MatrixStack p_230451_1_, int p_230451_2_, int p_230451_3_) private void
renderSlot
(MatrixStack p_238746_1_, Slot p_238746_2_) protected void
renderTooltip
(MatrixStack p_230459_1_, int p_230459_2_, int p_230459_3_) protected void
slotClicked
(Slot p_184098_1_, int p_184098_2_, int p_184098_3_, ClickType p_184098_4_) void
tick()
Methods inherited from class net.minecraft.client.gui.screen.Screen
addButton, addWidget, children, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, onFilesDrop, renderBackground, renderBackground, renderComponentHoverEffect, renderComponentTooltip, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderToolTip, renderWrappedToolTip, resize, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenError
Methods inherited from class net.minecraft.client.gui.FocusableGui
getFocused, isDragging, setDragging, setFocused
Methods inherited from class net.minecraft.client.gui.AbstractGui
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, 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.IGuiEventListener
mouseMoved
Methods inherited from interface net.minecraft.client.gui.INestedGuiEventHandler
changeFocus, charTyped, getChildAt, keyReleased, magicalSpecialHackyFocus, mouseScrolled, setInitialFocus
-
Field Details
-
INVENTORY_LOCATION
-
imageWidth
protected int imageWidth -
imageHeight
protected int imageHeight -
titleLabelX
protected int titleLabelX -
titleLabelY
protected int titleLabelY -
inventoryLabelX
protected int inventoryLabelX -
inventoryLabelY
protected int inventoryLabelY -
inventory
-
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
-
ContainerScreen
-
-
Method Details
-
init
protected void init() -
render
- Specified by:
render
in interfaceIRenderable
- Overrides:
render
in classScreen
-
renderTooltip
-
renderFloatingItem
-
renderLabels
-
renderBg
protected abstract void renderBg(MatrixStack p_230450_1_, float p_230450_2_, int p_230450_3_, int p_230450_4_) -
renderSlot
-
recalculateQuickCraftRemaining
private void recalculateQuickCraftRemaining() -
findSlot
-
mouseClicked
public boolean mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_) - Specified by:
mouseClicked
in interfaceIGuiEventListener
- Specified by:
mouseClicked
in interfaceINestedGuiEventHandler
-
checkHotbarMouseClicked
private void checkHotbarMouseClicked(int p_241609_1_) -
hasClickedOutside
protected boolean hasClickedOutside(double p_195361_1_, double p_195361_3_, int p_195361_5_, int p_195361_6_, int p_195361_7_) -
mouseDragged
public boolean mouseDragged(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_) - Specified by:
mouseDragged
in interfaceIGuiEventListener
- Specified by:
mouseDragged
in interfaceINestedGuiEventHandler
-
mouseReleased
public boolean mouseReleased(double p_231048_1_, double p_231048_3_, int p_231048_5_) - Specified by:
mouseReleased
in interfaceIGuiEventListener
- Specified by:
mouseReleased
in interfaceINestedGuiEventHandler
-
isHovering
-
isHovering
protected boolean isHovering(int p_195359_1_, int p_195359_2_, int p_195359_3_, int p_195359_4_, double p_195359_5_, double p_195359_7_) -
slotClicked
-
keyPressed
public boolean keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_) - Specified by:
keyPressed
in interfaceIGuiEventListener
- Specified by:
keyPressed
in interfaceINestedGuiEventHandler
- Overrides:
keyPressed
in classScreen
-
checkHotbarKeyPressed
protected boolean checkHotbarKeyPressed(int p_195363_1_, int p_195363_2_) -
removed
public void removed() -
isPauseScreen
public boolean isPauseScreen()- Overrides:
isPauseScreen
in classScreen
-
tick
public void tick() -
getMenu
- Specified by:
getMenu
in interfaceIHasContainer<T extends Container>
-
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()
-