Class ContainerScreen<T extends Container>

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 Details

    • 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 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 Details

  • Method Details

    • init

      protected void init()
      Overrides:
      init in class Screen
    • render

      public void render(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_)
      Specified by:
      render in interface IRenderable
      Overrides:
      render in class Screen
    • 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_, 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 interface IGuiEventListener
      Specified by:
      mouseClicked in interface INestedGuiEventHandler
    • 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 interface IGuiEventListener
      Specified by:
      mouseDragged in interface INestedGuiEventHandler
    • mouseReleased

      public boolean mouseReleased(double p_231048_1_, double p_231048_3_, int p_231048_5_)
      Specified by:
      mouseReleased in interface IGuiEventListener
      Specified by:
      mouseReleased in interface INestedGuiEventHandler
    • 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 interface IGuiEventListener
      Specified by:
      keyPressed in interface INestedGuiEventHandler
      Overrides:
      keyPressed in class Screen
    • checkHotbarKeyPressed

      protected boolean checkHotbarKeyPressed(int p_195363_1_, int p_195363_2_)
    • removed

      public void removed()
      Overrides:
      removed in class Screen
    • isPauseScreen

      public boolean isPauseScreen()
      Overrides:
      isPauseScreen in class Screen
    • tick

      public void tick()
      Specified by:
      tick in interface IScreen
      Overrides:
      tick in class Screen
    • getMenu

      public T getMenu()
      Specified by:
      getMenu in interface IHasContainer<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)
    • onClose

      public void onClose()
      Overrides:
      onClose in class Screen