Interface ListBackedContainer
- All Superinterfaces:
Clearable, Container, ContainerExtension, Iterable<ItemStack>, SlotProvider
- All Known Implementing Classes:
ChiseledBookShelfBlockEntity, ShelfBlockEntity
-
Nested Class Summary
Nested classes/interfaces inherited from interface Container
Container.ContainerIterator -
Field Summary
Fields inherited from interface Container
DEFAULT_DISTANCE_BUFFER -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanacceptsItemType(ItemStack itemStack) default booleancanPlaceItem(int slot, ItemStack itemStack) Returnstrueif automation is allowed to insert the given stack (ignoring stack size) into the given slot.default voiddefault intcount()default intdefault ItemStackgetItem(int slot) Returns the stack in the given slot.getItems()default booleanisEmpty()default ItemStackremoveItem(int slot, int count) Removes up to a specified number of items from an inventory slot and returns them in a new stack.default ItemStackremoveItemNoUpdate(int slot) Removes a stack from the given slot and returns it.default voidSets the given item stack to the specified slot in the inventory (can be crafting or armor sections).default voidsetItemNoUpdate(int slot, ItemStack itemStack) Methods inherited from interface Container
canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iterator, setChanged, startOpen, stillValid, stopOpenMethods inherited from interface ContainerExtension
onTransfer, setItemMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface SlotProvider
getSlotsFromRange
-
Method Details
-
getItems
NonNullList<ItemStack> getItems() -
count
default int count() -
getContainerSize
default int getContainerSize()- Specified by:
getContainerSizein interfaceContainer
-
clearContent
default void clearContent()- Specified by:
clearContentin interfaceClearable
-
isEmpty
-
getItem
-
removeItem
Description copied from interface:ContainerRemoves up to a specified number of items from an inventory slot and returns them in a new stack.- Specified by:
removeItemin interfaceContainer
-
removeItemNoUpdate
Description copied from interface:ContainerRemoves a stack from the given slot and returns it.- Specified by:
removeItemNoUpdatein interfaceContainer
-
canPlaceItem
Description copied from interface:ContainerReturnstrueif automation is allowed to insert the given stack (ignoring stack size) into the given slot. For guis use Slot.isItemValid- Specified by:
canPlaceItemin interfaceContainer
-
acceptsItemType
-
setItem
-
setItemNoUpdate
-