Class AbstractContainerMenu

java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
Direct Known Subclasses:
BeaconMenu, BrewingStandMenu, CartographyTableMenu, ChestMenu, ContainerTypeTest.TestContainer, CreativeModeInventoryScreen.ItemPickerMenu, DispenserMenu, EnchantmentMenu, GrindstoneMenu, HopperMenu, HorseInventoryMenu, ItemCombinerMenu, LecternMenu, LoomMenu, MerchantMenu, RecipeBookMenu, ShulkerBoxMenu, StonecutterMenu

public abstract class AbstractContainerMenu extends Object
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • SLOT_CLICKED_OUTSIDE

      public static final int SLOT_CLICKED_OUTSIDE
      See Also:
    • QUICKCRAFT_TYPE_CHARITABLE

      public static final int QUICKCRAFT_TYPE_CHARITABLE
      See Also:
    • QUICKCRAFT_TYPE_GREEDY

      public static final int QUICKCRAFT_TYPE_GREEDY
      See Also:
    • QUICKCRAFT_TYPE_CLONE

      public static final int QUICKCRAFT_TYPE_CLONE
      See Also:
    • QUICKCRAFT_HEADER_START

      public static final int QUICKCRAFT_HEADER_START
      See Also:
    • QUICKCRAFT_HEADER_CONTINUE

      public static final int QUICKCRAFT_HEADER_CONTINUE
      See Also:
    • QUICKCRAFT_HEADER_END

      public static final int QUICKCRAFT_HEADER_END
      See Also:
    • CARRIED_SLOT_SIZE

      public static final int CARRIED_SLOT_SIZE
      See Also:
    • lastSlots

      private final NonNullList<ItemStack> lastSlots
    • slots

      public final NonNullList<Slot> slots
    • dataSlots

      private final List<DataSlot> dataSlots
    • carried

      private ItemStack carried
    • remoteSlots

      private final NonNullList<ItemStack> remoteSlots
    • remoteDataSlots

      private final it.unimi.dsi.fastutil.ints.IntList remoteDataSlots
    • remoteCarried

      private ItemStack remoteCarried
    • stateId

      private int stateId
    • containerId

      public final int containerId
    • quickcraftType

      private int quickcraftType
    • quickcraftStatus

      private int quickcraftStatus
    • quickcraftSlots

      private final Set<Slot> quickcraftSlots
    • containerListeners

      private final List<ContainerListener> containerListeners
    • synchronizer

      @Nullable private ContainerSynchronizer synchronizer
    • suppressRemoteUpdates

      private boolean suppressRemoteUpdates
  • Constructor Details

    • AbstractContainerMenu

      protected AbstractContainerMenu(@Nullable MenuType<?> p_38851_, int p_38852_)
  • Method Details

    • stillValid

      protected static boolean stillValid(ContainerLevelAccess p_38890_, Player p_38891_, Block p_38892_)
    • getType

      public MenuType<?> getType()
    • checkContainerSize

      protected static void checkContainerSize(Container p_38870_, int p_38871_)
    • checkContainerDataCount

      protected static void checkContainerDataCount(ContainerData p_38887_, int p_38888_)
    • isValidSlotIndex

      public boolean isValidSlotIndex(int p_207776_)
    • addSlot

      protected Slot addSlot(Slot p_38898_)
    • addDataSlot

      protected DataSlot addDataSlot(DataSlot p_38896_)
    • addDataSlots

      protected void addDataSlots(ContainerData p_38885_)
    • addSlotListener

      public void addSlotListener(ContainerListener p_38894_)
    • setSynchronizer

      public void setSynchronizer(ContainerSynchronizer p_150417_)
    • sendAllDataToRemote

      public void sendAllDataToRemote()
    • removeSlotListener

      public void removeSlotListener(ContainerListener p_38944_)
    • getItems

      public NonNullList<ItemStack> getItems()
    • broadcastChanges

      public void broadcastChanges()
    • broadcastFullState

      public void broadcastFullState()
    • updateDataSlotListeners

      private void updateDataSlotListeners(int p_182421_, int p_182422_)
    • triggerSlotListeners

      private void triggerSlotListeners(int p_150408_, ItemStack p_150409_, Supplier<ItemStack> p_150410_)
    • synchronizeSlotToRemote

      private void synchronizeSlotToRemote(int p_150436_, ItemStack p_150437_, Supplier<ItemStack> p_150438_)
    • synchronizeDataSlotToRemote

      private void synchronizeDataSlotToRemote(int p_150441_, int p_150442_)
    • synchronizeCarriedToRemote

      private void synchronizeCarriedToRemote()
    • setRemoteSlot

      public void setRemoteSlot(int p_150405_, ItemStack p_150406_)
    • setRemoteSlotNoCopy

      public void setRemoteSlotNoCopy(int p_182415_, ItemStack p_182416_)
    • setRemoteCarried

      public void setRemoteCarried(ItemStack p_150423_)
    • clickMenuButton

      public boolean clickMenuButton(Player p_38875_, int p_38876_)
    • getSlot

      public Slot getSlot(int p_38854_)
    • quickMoveStack

      public abstract ItemStack quickMoveStack(Player p_38941_, int p_38942_)
    • clicked

      public void clicked(int p_150400_, int p_150401_, ClickType p_150402_, Player p_150403_)
    • doClick

      private void doClick(int p_150431_, int p_150432_, ClickType p_150433_, Player p_150434_)
    • tryItemClickBehaviourOverride

      private boolean tryItemClickBehaviourOverride(Player p_249615_, ClickAction p_250300_, Slot p_249384_, ItemStack p_251073_, ItemStack p_252026_)
    • createCarriedSlotAccess

      private SlotAccess createCarriedSlotAccess()
    • canTakeItemForPickAll

      public boolean canTakeItemForPickAll(ItemStack p_38908_, Slot p_38909_)
    • removed

      public void removed(Player p_38940_)
    • clearContainer

      protected void clearContainer(Player p_150412_, Container p_150413_)
    • slotsChanged

      public void slotsChanged(Container p_38868_)
    • setItem

      public void setItem(int p_182407_, int p_182408_, ItemStack p_182409_)
    • initializeContents

      public void initializeContents(int p_182411_, List<ItemStack> p_182412_, ItemStack p_182413_)
    • setData

      public void setData(int p_38855_, int p_38856_)
    • stillValid

      public abstract boolean stillValid(Player p_38874_)
    • moveItemStackTo

      protected boolean moveItemStackTo(ItemStack p_38904_, int p_38905_, int p_38906_, boolean p_38907_)
    • getQuickcraftType

      public static int getQuickcraftType(int p_38929_)
    • getQuickcraftHeader

      public static int getQuickcraftHeader(int p_38948_)
    • getQuickcraftMask

      public static int getQuickcraftMask(int p_38931_, int p_38932_)
    • isValidQuickcraftType

      public static boolean isValidQuickcraftType(int p_38863_, Player p_38864_)
    • resetQuickCraft

      protected void resetQuickCraft()
    • canItemQuickReplace

      public static boolean canItemQuickReplace(@Nullable Slot p_38900_, ItemStack p_38901_, boolean p_38902_)
    • getQuickCraftPlaceCount

      public static int getQuickCraftPlaceCount(Set<Slot> p_279393_, int p_279288_, ItemStack p_279172_)
    • canDragTo

      public boolean canDragTo(Slot p_38945_)
    • getRedstoneSignalFromBlockEntity

      public static int getRedstoneSignalFromBlockEntity(@Nullable BlockEntity p_38919_)
    • getRedstoneSignalFromContainer

      public static int getRedstoneSignalFromContainer(@Nullable Container p_38939_)
    • setCarried

      public void setCarried(ItemStack p_150439_)
    • getCarried

      public ItemStack getCarried()
    • suppressRemoteUpdates

      public void suppressRemoteUpdates()
    • resumeRemoteUpdates

      public void resumeRemoteUpdates()
    • transferState

      public void transferState(AbstractContainerMenu p_150415_)
    • findSlot

      public OptionalInt findSlot(Container p_182418_, int p_182419_)
    • getStateId

      public int getStateId()
    • incrementStateId

      public int incrementStateId()