Class SimpleContainer
java.lang.Object
net.minecraft.world.SimpleContainer
- All Implemented Interfaces:
Iterable<ItemStack>, Clearable, Container, SlotProvider, StackedContentsCompatible, ContainerExtension
- Direct Known Subclasses:
ComposterBlock.EmptyContainer, ComposterBlock.InputContainer, ComposterBlock.OutputContainer, PlayerEnderChestContainer
-
Nested Class Summary
Nested classes/interfaces inherited from interface Container
Container.ContainerIterator -
Field Summary
FieldsFields inherited from interface Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAddItem(ItemStack itemStack) voidvoidfillStackedContents(StackedItemContents contents) voidintgetItem(int slot) getItems()booleanisEmpty()private voidmoveItemsBetweenStacks(ItemStack sourceStack, ItemStack targetStack) private voidmoveItemToEmptySlots(ItemStack sourceStack) private voidmoveItemToOccupiedSlotsWithSameType(ItemStack sourceStack) removeItem(int slot, int count) removeItemNoUpdate(int slot) removeItemType(Item itemType, int count) voidvoidvoidAn extension ofContainer.setItem(int, ItemStack)that allows non-transactional side-effects to be skipped.booleanstillValid(Player player) voidtoString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
canPlaceItem, canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iterator, startOpen, stopOpenMethods inherited from interface ContainerExtension
onTransferMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface SlotProvider
getSlotsFromRange
-
Field Details
-
size
private final int size -
items
-
-
Constructor Details
-
SimpleContainer
public SimpleContainer(int size) -
SimpleContainer
-
-
Method Details
-
getItem
-
removeAllItems
-
removeItem
- Specified by:
removeItemin interfaceContainer
-
removeItemType
-
addItem
-
canAddItem
-
removeItemNoUpdate
- Specified by:
removeItemNoUpdatein interfaceContainer
-
setItem
-
setItem
Description copied from interface:ContainerExtensionAn extension ofContainer.setItem(int, ItemStack)that allows non-transactional side-effects to be skipped. Non-transactional side-effects include for example callingsetChangedor making changes to the world.- Specified by:
setItemin interfaceContainerExtension- Parameters:
insideTransaction- Whentrue, non-transactional actions should be deferred. Whenfalse, non-transactional actions can be performed immediately.- See Also:
-
setChanged
public void setChanged()- Specified by:
setChangedin interfaceContainer
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfaceContainer
-
isEmpty
-
stillValid
- Specified by:
stillValidin interfaceContainer
-
clearContent
public void clearContent()- Specified by:
clearContentin interfaceClearable
-
fillStackedContents
- Specified by:
fillStackedContentsin interfaceStackedContentsCompatible
-
toString
-
moveItemToEmptySlots
-
moveItemToOccupiedSlotsWithSameType
-
moveItemsBetweenStacks
-
fromItemList
-
storeAsItemList
-
getItems
-