Interface ListBackedContainer

All Superinterfaces:
Clearable, Container, ContainerExtension, Iterable<ItemStack>
All Known Implementing Classes:
ChiseledBookShelfBlockEntity, ShelfBlockEntity

public interface ListBackedContainer extends Container
  • Method Details

    • getItems

      NonNullList<ItemStack> getItems()
    • count

      default int count()
    • getContainerSize

      default int getContainerSize()
      Specified by:
      getContainerSize in interface Container
    • clearContent

      default void clearContent()
      Specified by:
      clearContent in interface Clearable
    • isEmpty

      default boolean isEmpty()
      Specified by:
      isEmpty in interface Container
    • getItem

      default ItemStack getItem(int p_435306_)
      Description copied from interface: Container
      Returns the stack in the given slot.
      Specified by:
      getItem in interface Container
    • removeItem

      default ItemStack removeItem(int p_433717_, int p_433464_)
      Description copied from interface: Container
      Removes up to a specified number of items from an inventory slot and returns them in a new stack.
      Specified by:
      removeItem in interface Container
    • removeItemNoUpdate

      default ItemStack removeItemNoUpdate(int p_435020_)
      Description copied from interface: Container
      Removes a stack from the given slot and returns it.
      Specified by:
      removeItemNoUpdate in interface Container
    • canPlaceItem

      default boolean canPlaceItem(int p_434183_, ItemStack p_435584_)
      Description copied from interface: Container
      Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For guis use Slot.isItemValid
      Specified by:
      canPlaceItem in interface Container
    • acceptsItemType

      default boolean acceptsItemType(ItemStack pStack)
    • setItem

      default void setItem(int p_434398_, ItemStack p_434868_)
      Description copied from interface: Container
      Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
      Specified by:
      setItem in interface Container
    • setItemNoUpdate

      default void setItemNoUpdate(int pSlot, ItemStack pStack)