Class Container

java.lang.Object
net.minecraft.inventory.container.Container
Direct Known Subclasses:
AbstractRepairContainer, BeaconContainer, BrewingStandContainer, CartographyContainer, ChestContainer, ContainerTypeTest.TestContainer, CreativeScreen.CreativeContainer, DispenserContainer, EnchantmentContainer, GrindstoneContainer, HopperContainer, HorseInventoryContainer, LecternContainer, LoomContainer, MerchantContainer, RecipeBookContainer, ShulkerBoxContainer, StonecutterContainer

public abstract class Container extends Object
  • Field Details

    • lastSlots

      private final NonNullList<ItemStack> lastSlots
    • slots

      public final List<Slot> slots
    • dataSlots

      private final List<IntReferenceHolder> dataSlots
    • containerId

      public final int containerId
    • changeUid

      private short changeUid
    • quickcraftType

      private int quickcraftType
    • quickcraftStatus

      private int quickcraftStatus
    • quickcraftSlots

      private final Set<Slot> quickcraftSlots
    • containerListeners

      private final List<IContainerListener> containerListeners
    • unSynchedPlayers

      private final Set<PlayerEntity> unSynchedPlayers
  • Constructor Details

    • Container

      protected Container(@Nullable ContainerType<?> p_i50105_1_, int p_i50105_2_)
  • Method Details

    • stillValid

      protected static boolean stillValid(IWorldPosCallable p_216963_0_, PlayerEntity p_216963_1_, Block p_216963_2_)
    • getType

      public ContainerType<?> getType()
    • checkContainerSize

      protected static void checkContainerSize(IInventory p_216962_0_, int p_216962_1_)
    • checkContainerDataCount

      protected static void checkContainerDataCount(IIntArray p_216959_0_, int p_216959_1_)
    • addSlot

      protected Slot addSlot(Slot p_75146_1_)
    • addDataSlot

      protected IntReferenceHolder addDataSlot(IntReferenceHolder p_216958_1_)
    • addDataSlots

      protected void addDataSlots(IIntArray p_216961_1_)
    • addSlotListener

      public void addSlotListener(IContainerListener p_75132_1_)
    • removeSlotListener

      public void removeSlotListener(IContainerListener p_82847_1_)
    • getItems

      public NonNullList<ItemStack> getItems()
    • broadcastChanges

      public void broadcastChanges()
    • clickMenuButton

      public boolean clickMenuButton(PlayerEntity p_75140_1_, int p_75140_2_)
    • getSlot

      public Slot getSlot(int p_75139_1_)
    • quickMoveStack

      public ItemStack quickMoveStack(PlayerEntity p_82846_1_, int p_82846_2_)
    • clicked

      public ItemStack clicked(int p_184996_1_, int p_184996_2_, ClickType p_184996_3_, PlayerEntity p_184996_4_)
    • doClick

      private ItemStack doClick(int p_241440_1_, int p_241440_2_, ClickType p_241440_3_, PlayerEntity p_241440_4_)
    • consideredTheSameItem

      public static boolean consideredTheSameItem(ItemStack p_195929_0_, ItemStack p_195929_1_)
    • canTakeItemForPickAll

      public boolean canTakeItemForPickAll(ItemStack p_94530_1_, Slot p_94530_2_)
    • removed

      public void removed(PlayerEntity p_75134_1_)
    • clearContainer

      protected void clearContainer(PlayerEntity p_193327_1_, World p_193327_2_, IInventory p_193327_3_)
    • slotsChanged

      public void slotsChanged(IInventory p_75130_1_)
    • setItem

      public void setItem(int p_75141_1_, ItemStack p_75141_2_)
    • setAll

      public void setAll(List<ItemStack> p_190896_1_)
    • setData

      public void setData(int p_75137_1_, int p_75137_2_)
    • backup

      public short backup(PlayerInventory p_75136_1_)
    • isSynched

      public boolean isSynched(PlayerEntity p_75129_1_)
    • setSynched

      public void setSynched(PlayerEntity p_75128_1_, boolean p_75128_2_)
    • stillValid

      public abstract boolean stillValid(PlayerEntity p_75145_1_)
    • moveItemStackTo

      protected boolean moveItemStackTo(ItemStack p_75135_1_, int p_75135_2_, int p_75135_3_, boolean p_75135_4_)
    • getQuickcraftType

      public static int getQuickcraftType(int p_94529_0_)
    • getQuickcraftHeader

      public static int getQuickcraftHeader(int p_94532_0_)
    • getQuickcraftMask

      public static int getQuickcraftMask(int p_94534_0_, int p_94534_1_)
    • isValidQuickcraftType

      public static boolean isValidQuickcraftType(int p_180610_0_, PlayerEntity p_180610_1_)
    • resetQuickCraft

      protected void resetQuickCraft()
    • canItemQuickReplace

      public static boolean canItemQuickReplace(@Nullable Slot p_94527_0_, ItemStack p_94527_1_, boolean p_94527_2_)
    • getQuickCraftSlotCount

      public static void getQuickCraftSlotCount(Set<Slot> p_94525_0_, int p_94525_1_, ItemStack p_94525_2_, int p_94525_3_)
    • canDragTo

      public boolean canDragTo(Slot p_94531_1_)
    • getRedstoneSignalFromBlockEntity

      public static int getRedstoneSignalFromBlockEntity(@Nullable TileEntity p_178144_0_)
    • getRedstoneSignalFromContainer

      public static int getRedstoneSignalFromContainer(@Nullable IInventory p_94526_0_)