Class AbstractGridContainerMenu

java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
All Implemented Interfaces:
GridWatcher, GridExtractionStrategy, GridInsertionStrategy, GridScrollingStrategy, ScreenSizeListener
Direct Known Subclasses:
AbstractPortableGridContainerMenu, CraftingGridContainerMenu, GridContainerMenu, PatternGridContainerMenu, WirelessGridContainerMenu

  • Field Details

    • playerInventory

      protected final net.minecraft.world.entity.player.Inventory playerInventory
  • Constructor Details

    • AbstractGridContainerMenu

      protected AbstractGridContainerMenu(net.minecraft.world.inventory.MenuType<? extends AbstractGridContainerMenu> menuType, int syncId, net.minecraft.world.entity.player.Inventory playerInventory, GridData gridData)
    • AbstractGridContainerMenu

      protected AbstractGridContainerMenu(net.minecraft.world.inventory.MenuType<? extends AbstractGridContainerMenu> menuType, int syncId, net.minecraft.world.entity.player.Inventory playerInventory, Grid grid)
  • Method Details

    • onResourceUpdate

      public void onResourceUpdate(ResourceKey resource, long amount, @Nullable TrackedResource trackedResource)
    • getSortingDirection

      public GridSortingDirection getSortingDirection()
    • setSortingDirection

      public void setSortingDirection(GridSortingDirection sortingDirection)
    • getSortingType

      public GridSortingTypes getSortingType()
    • setSortingType

      public void setSortingType(GridSortingTypes sortingType)
    • setSearchBox

      public void setSearchBox(GridSearchBox searchBox)
    • removed

      public void removed(net.minecraft.world.entity.player.Player playerEntity)
      Overrides:
      removed in class net.minecraft.world.inventory.AbstractContainerMenu
    • onScreenReady

      public void onScreenReady(int playerInventoryY)
      Specified by:
      onScreenReady in interface ScreenSizeListener
    • getView

      public GridView getView()
    • onActiveChanged

      public void onActiveChanged(boolean newActive)
      Description copied from interface: GridWatcher
      Called when the activeness state of the grid has changed.
      Specified by:
      onActiveChanged in interface GridWatcher
      Parameters:
      newActive - the new activeness state
    • onChanged

      public void onChanged(ResourceKey resource, long change, @Nullable TrackedResource trackedResource)
      Description copied from interface: GridWatcher
      Called when a resource is changed.
      Specified by:
      onChanged in interface GridWatcher
      Parameters:
      resource - the resource
      change - the changed amount
      trackedResource - the tracked resource, if present
    • invalidate

      public void invalidate()
      Description copied from interface: GridWatcher
      Usually called when the grid network has been changed.
      Specified by:
      invalidate in interface GridWatcher
    • isActive

      public boolean isActive()
    • setAutoSelected

      public void setAutoSelected(boolean autoSelected)
    • isAutoSelected

      public boolean isAutoSelected()
    • getSynchronizer

      public GridSynchronizer getSynchronizer()
    • getResourceType

      @Nullable public ResourceType getResourceType()
    • toggleSynchronizer

      public void toggleSynchronizer()
    • toggleResourceType

      public void toggleResourceType()
    • onInsert

      public boolean onInsert(GridInsertMode insertMode, boolean tryAlternatives)
      Specified by:
      onInsert in interface GridInsertionStrategy
    • onExtract

      public boolean onExtract(PlatformResourceKey resource, GridExtractMode extractMode, boolean cursor)
      Specified by:
      onExtract in interface GridExtractionStrategy
    • onScroll

      public boolean onScroll(PlatformResourceKey resource, GridScrollMode scrollMode, int slotIndex)
      Specified by:
      onScroll in interface GridScrollingStrategy
    • onTransfer

      public boolean onTransfer(int slotIndex)
      Specified by:
      onTransfer in interface GridInsertionStrategy
    • quickMoveStack

      public net.minecraft.world.item.ItemStack quickMoveStack(net.minecraft.world.entity.player.Player playerEntity, int slotIndex)
      Overrides:
      quickMoveStack in class AbstractBaseContainerMenu
    • canTransferSlot

      protected boolean canTransferSlot(net.minecraft.world.inventory.Slot slot)
    • onClear

      public void onClear()