Class AbstractContainerScreen<T extends AbstractContainerMenu>

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Widget, MenuAccess<T>
Direct Known Subclasses:
AbstractFurnaceScreen, BeaconScreen, BrewingStandScreen, CartographyTableScreen, ContainerScreen, ContainerTypeTest.TestGui, CraftingScreen, DispenserScreen, EffectRenderingInventoryScreen, EnchantmentScreen, GrindstoneScreen, HopperScreen, HorseInventoryScreen, ItemCombinerScreen, LoomScreen, MerchantScreen, ShulkerBoxScreen, StonecutterScreen

public abstract class AbstractContainerScreen<T extends AbstractContainerMenu> extends Screen implements MenuAccess<T>
  • Field Details

    • INVENTORY_LOCATION

      public static final ResourceLocation INVENTORY_LOCATION
    • SNAPBACK_SPEED

      private static final float SNAPBACK_SPEED
      See Also:
      Constant Field Values
    • QUICKDROP_DELAY

      private static final int QUICKDROP_DELAY
      See Also:
      Constant Field Values
    • DOUBLECLICK_SPEED

      private static final int DOUBLECLICK_SPEED
      See Also:
      Constant Field Values
    • SLOT_ITEM_BLIT_OFFSET

      public static final int SLOT_ITEM_BLIT_OFFSET
      See Also:
      Constant Field Values
    • HOVER_ITEM_BLIT_OFFSET

      private static final int HOVER_ITEM_BLIT_OFFSET
      See Also:
      Constant Field Values
    • 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

      protected final Component playerInventoryTitle
    • 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

    • AbstractContainerScreen

      public AbstractContainerScreen(T p_97741_, Inventory p_97742_, Component p_97743_)
  • Method Details

    • init

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

      public void render(PoseStack p_97795_, int p_97796_, int p_97797_, float p_97798_)
      Specified by:
      render in interface Widget
      Overrides:
      render in class Screen
    • 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

      protected void renderTooltip(PoseStack p_97791_, int p_97792_, int p_97793_)
    • renderFloatingItem

      private void renderFloatingItem(ItemStack p_97783_, int p_97784_, int p_97785_, String p_97786_)
    • renderLabels

      protected void renderLabels(PoseStack p_97808_, int p_97809_, int p_97810_)
    • renderBg

      protected abstract void renderBg(PoseStack p_97787_, float p_97788_, int p_97789_, int p_97790_)
    • renderSlot

      private void renderSlot(PoseStack p_97800_, Slot p_97801_)
    • recalculateQuickCraftRemaining

      private void recalculateQuickCraftRemaining()
    • findSlot

      @Nullable private Slot findSlot(double p_97745_, double p_97746_)
    • mouseClicked

      public boolean mouseClicked(double p_97748_, double p_97749_, int p_97750_)
      Specified by:
      mouseClicked in interface ContainerEventHandler
      Specified by:
      mouseClicked in interface GuiEventListener
    • 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 interface ContainerEventHandler
      Specified by:
      mouseDragged in interface GuiEventListener
    • mouseReleased

      public boolean mouseReleased(double p_97812_, double p_97813_, int p_97814_)
      Specified by:
      mouseReleased in interface ContainerEventHandler
      Specified by:
      mouseReleased in interface GuiEventListener
    • isHovering

      private boolean isHovering(Slot p_97775_, double p_97776_, double p_97777_)
    • isHovering

      protected boolean isHovering(int p_97768_, int p_97769_, int p_97770_, int p_97771_, double p_97772_, double p_97773_)
    • slotClicked

      protected void slotClicked(Slot p_97778_, int p_97779_, int p_97780_, ClickType p_97781_)
    • keyPressed

      public boolean keyPressed(int p_97765_, int p_97766_, int p_97767_)
      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class Screen
    • checkHotbarKeyPressed

      protected boolean checkHotbarKeyPressed(int p_97806_, int p_97807_)
    • removed

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

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

      public final void tick()
      Overrides:
      tick in class Screen
    • containerTick

      protected void containerTick()
    • getMenu

      public T getMenu()
      Specified by:
      getMenu in interface MenuAccess<T extends AbstractContainerMenu>
    • 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