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
-
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
Constructors Constructor Description ContainerScreen(T p_i51105_1_, PlayerInventory p_i51105_2_, ITextComponent p_i51105_3_)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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
getGuiLeft()
int
getGuiTop()
T
getMenu()
int
getSlotColor(int index)
Slot
getSlotUnderMouse()
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
isPauseScreen()
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
recalculateQuickCraftRemaining()
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_, java.lang.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 Detail
-
INVENTORY_LOCATION
public static final ResourceLocation 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
protected final PlayerInventory inventory
-
hoveredSlot
@Nullable protected Slot hoveredSlot
-
clickedSlot
@Nullable private Slot clickedSlot
-
snapbackEnd
@Nullable private Slot snapbackEnd
-
quickdropSlot
@Nullable private Slot quickdropSlot
-
lastClickSlot
@Nullable private Slot lastClickSlot
-
leftPos
protected int leftPos
-
topPos
protected int topPos
-
isSplittingStack
private boolean isSplittingStack
-
draggingItem
private ItemStack draggingItem
-
snapbackStartX
private int snapbackStartX
-
snapbackStartY
private int snapbackStartY
-
snapbackTime
private long snapbackTime
-
snapbackItem
private ItemStack snapbackItem
-
quickdropTime
private long quickdropTime
-
quickCraftSlots
protected final java.util.Set<Slot> 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
private ItemStack lastQuickMoved
-
slotColor
protected int slotColor
-
-
Constructor Detail
-
ContainerScreen
public ContainerScreen(T p_i51105_1_, PlayerInventory p_i51105_2_, ITextComponent p_i51105_3_)
-
-
Method Detail
-
render
public void render(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_)
- Specified by:
render
in interfaceIRenderable
- Overrides:
render
in classScreen
-
renderTooltip
protected void renderTooltip(MatrixStack p_230459_1_, int p_230459_2_, int p_230459_3_)
-
renderFloatingItem
private void renderFloatingItem(ItemStack p_146982_1_, int p_146982_2_, int p_146982_3_, java.lang.String p_146982_4_)
-
renderLabels
protected void renderLabels(MatrixStack p_230451_1_, int p_230451_2_, int p_230451_3_)
-
renderBg
protected abstract void renderBg(MatrixStack p_230450_1_, float p_230450_2_, int p_230450_3_, int p_230450_4_)
-
renderSlot
private void renderSlot(MatrixStack p_238746_1_, Slot p_238746_2_)
-
recalculateQuickCraftRemaining
private void recalculateQuickCraftRemaining()
-
findSlot
@Nullable private Slot findSlot(double p_195360_1_, double p_195360_3_)
-
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
private boolean isHovering(Slot p_195362_1_, double p_195362_2_, double p_195362_4_)
-
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
protected void slotClicked(Slot p_184098_1_, int p_184098_2_, int p_184098_3_, ClickType p_184098_4_)
-
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_)
-
isPauseScreen
public boolean isPauseScreen()
- Overrides:
isPauseScreen
in classScreen
-
getMenu
public T getMenu()
- Specified by:
getMenu
in interfaceIHasContainer<T extends Container>
-
getSlotUnderMouse
@Nullable public Slot getSlotUnderMouse()
-
getGuiLeft
public int getGuiLeft()
-
getGuiTop
public int getGuiTop()
-
getXSize
public int getXSize()
-
getYSize
public int getYSize()
-
getSlotColor
public int getSlotColor(int index)
-
-