Package net.minecraft.world
Class SimpleContainer
java.lang.Object
net.minecraft.world.SimpleContainer
- All Implemented Interfaces:
Clearable
,Container
,StackedContentsCompatible
- Direct Known Subclasses:
ComposterBlock.EmptyContainer
,ComposterBlock.InputContainer
,ComposterBlock.OutputContainer
,PlayerEnderChestContainer
,RecipeBookExtensionTest.RecipeBookTestContainer
-
Field Summary
Modifier and TypeFieldDescriptionprivate final NonNullList<ItemStack>
private List<ContainerListener>
private final int
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(ContainerListener p_19165_) boolean
canAddItem
(ItemStack p_19184_) void
void
fillStackedContents
(StackedContents p_19169_) void
int
getItem
(int p_19157_) boolean
isEmpty()
private void
moveItemsBetweenStacks
(ItemStack p_19186_, ItemStack p_19187_) private void
moveItemToEmptySlots
(ItemStack p_19190_) private void
moveItemToOccupiedSlotsWithSameType
(ItemStack p_19192_) removeItem
(int p_19159_, int p_19160_) removeItemNoUpdate
(int p_19180_) removeItemType
(Item p_19171_, int p_19172_) void
removeListener
(ContainerListener p_19182_) void
void
boolean
stillValid
(Player p_19167_) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpen
-
Field Details
-
size
private final int size -
items
-
listeners
-
-
Constructor Details
-
SimpleContainer
public SimpleContainer(int p_19150_) -
SimpleContainer
-
-
Method Details
-
addListener
-
removeListener
-
getItem
-
removeAllItems
-
removeItem
- Specified by:
removeItem
in interfaceContainer
-
removeItemType
-
addItem
-
canAddItem
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdate
in interfaceContainer
-
setItem
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceContainer
-
isEmpty
public boolean isEmpty() -
setChanged
public void setChanged()- Specified by:
setChanged
in interfaceContainer
-
stillValid
- Specified by:
stillValid
in interfaceContainer
-
clearContent
public void clearContent()- Specified by:
clearContent
in interfaceClearable
-
fillStackedContents
- Specified by:
fillStackedContents
in interfaceStackedContentsCompatible
-
toString
-
moveItemToEmptySlots
-
moveItemToOccupiedSlotsWithSameType
-
moveItemsBetweenStacks
-
fromTag
-
createTag
-