Interface ListBackedContainer
- All Superinterfaces:
Clearable,Container,ContainerExtension,Iterable<ItemStack>
- All Known Implementing Classes:
ChiseledBookShelfBlockEntity,ShelfBlockEntity
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.Container
Container.ContainerIterator -
Field Summary
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanacceptsItemType(ItemStack pStack) default booleancanPlaceItem(int p_434183_, ItemStack p_435584_) Returnstrueif automation is allowed to insert the given stack (ignoring stack size) into the given slot.default voiddefault intcount()default intdefault ItemStackgetItem(int p_435306_) Returns the stack in the given slot.getItems()default booleanisEmpty()default ItemStackremoveItem(int p_433717_, int p_433464_) Removes up to a specified number of items from an inventory slot and returns them in a new stack.default ItemStackremoveItemNoUpdate(int p_435020_) 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 pSlot, ItemStack pStack) Methods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, iterator, setChanged, startOpen, stillValid, stopOpenMethods inherited from interface net.neoforged.neoforge.common.extensions.ContainerExtension
onTransfer, setItemMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
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
default boolean isEmpty() -
getItem
Description copied from interface:ContainerReturns the stack in the given slot. -
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
Description copied from interface:ContainerSets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -
setItemNoUpdate
-