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 java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private short
changeUid
int
containerId
private java.util.List<IContainerListener>
containerListeners
private java.util.List<IntReferenceHolder>
dataSlots
private NonNullList<ItemStack>
lastSlots
private ContainerType<?>
menuType
private java.util.Set<Slot>
quickcraftSlots
private int
quickcraftStatus
private int
quickcraftType
java.util.List<Slot>
slots
private java.util.Set<PlayerEntity>
unSynchedPlayers
-
Constructor Summary
Constructors Modifier Constructor Description protected
Container(ContainerType<?> p_i50105_1_, int p_i50105_2_)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected IntReferenceHolder
addDataSlot(IntReferenceHolder p_216958_1_)
protected void
addDataSlots(IIntArray p_216961_1_)
protected Slot
addSlot(Slot p_75146_1_)
void
addSlotListener(IContainerListener p_75132_1_)
short
backup(PlayerInventory p_75136_1_)
void
broadcastChanges()
boolean
canDragTo(Slot p_94531_1_)
static boolean
canItemQuickReplace(Slot p_94527_0_, ItemStack p_94527_1_, boolean p_94527_2_)
boolean
canTakeItemForPickAll(ItemStack p_94530_1_, Slot p_94530_2_)
protected static void
checkContainerDataCount(IIntArray p_216959_0_, int p_216959_1_)
protected static void
checkContainerSize(IInventory p_216962_0_, int p_216962_1_)
protected void
clearContainer(PlayerEntity p_193327_1_, World p_193327_2_, IInventory p_193327_3_)
ItemStack
clicked(int p_184996_1_, int p_184996_2_, ClickType p_184996_3_, PlayerEntity p_184996_4_)
boolean
clickMenuButton(PlayerEntity p_75140_1_, int p_75140_2_)
static boolean
consideredTheSameItem(ItemStack p_195929_0_, ItemStack p_195929_1_)
private ItemStack
doClick(int p_241440_1_, int p_241440_2_, ClickType p_241440_3_, PlayerEntity p_241440_4_)
NonNullList<ItemStack>
getItems()
static int
getQuickcraftHeader(int p_94532_0_)
static int
getQuickcraftMask(int p_94534_0_, int p_94534_1_)
static void
getQuickCraftSlotCount(java.util.Set<Slot> p_94525_0_, int p_94525_1_, ItemStack p_94525_2_, int p_94525_3_)
static int
getQuickcraftType(int p_94529_0_)
static int
getRedstoneSignalFromBlockEntity(TileEntity p_178144_0_)
static int
getRedstoneSignalFromContainer(IInventory p_94526_0_)
Slot
getSlot(int p_75139_1_)
ContainerType<?>
getType()
boolean
isSynched(PlayerEntity p_75129_1_)
static boolean
isValidQuickcraftType(int p_180610_0_, PlayerEntity p_180610_1_)
protected boolean
moveItemStackTo(ItemStack p_75135_1_, int p_75135_2_, int p_75135_3_, boolean p_75135_4_)
ItemStack
quickMoveStack(PlayerEntity p_82846_1_, int p_82846_2_)
void
removed(PlayerEntity p_75134_1_)
void
removeSlotListener(IContainerListener p_82847_1_)
protected void
resetQuickCraft()
void
setAll(java.util.List<ItemStack> p_190896_1_)
void
setData(int p_75137_1_, int p_75137_2_)
void
setItem(int p_75141_1_, ItemStack p_75141_2_)
void
setSynched(PlayerEntity p_75128_1_, boolean p_75128_2_)
void
slotsChanged(IInventory p_75130_1_)
abstract boolean
stillValid(PlayerEntity p_75145_1_)
protected static boolean
stillValid(IWorldPosCallable p_216963_0_, PlayerEntity p_216963_1_, Block p_216963_2_)
-
-
-
Field Detail
-
lastSlots
private final NonNullList<ItemStack> lastSlots
-
slots
public final java.util.List<Slot> slots
-
dataSlots
private final java.util.List<IntReferenceHolder> dataSlots
-
menuType
@Nullable private final ContainerType<?> menuType
-
containerId
public final int containerId
-
changeUid
private short changeUid
-
quickcraftType
private int quickcraftType
-
quickcraftStatus
private int quickcraftStatus
-
quickcraftSlots
private final java.util.Set<Slot> quickcraftSlots
-
containerListeners
private final java.util.List<IContainerListener> containerListeners
-
unSynchedPlayers
private final java.util.Set<PlayerEntity> unSynchedPlayers
-
-
Constructor Detail
-
Container
protected Container(@Nullable ContainerType<?> p_i50105_1_, int p_i50105_2_)
-
-
Method Detail
-
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_)
-
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_)
-
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(java.util.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(java.util.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_)
-
-