Interface ListBackedContainer

All Superinterfaces:
Clearable, Container, ContainerExtension, Iterable<ItemStack>, SlotProvider
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 slot)
      Description copied from interface: Container
      Returns the stack in the given slot.
      Specified by:
      getItem in interface Container
    • removeItem

      default ItemStack removeItem(int slot, int count)
      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 slot)
      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 slot, ItemStack itemStack)
      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 itemStack)
    • setItem

      default void setItem(int slot, ItemStack itemStack)
      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 slot, ItemStack itemStack)