Interface Container

All Known Implementing Classes:
EnderChestInventory, PlayerInventory

public interface Container
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears every slot.
    get(int slot)
    Returns the contents of the requested slot, never null.
    boolean
    true if every slot is empty.
    void
    set(int slot, @Nullable ItemStack stack)
    Replaces the contents of a slot.
    int
    Number of slots exposed by this container.
  • Method Details

    • size

      int size()
      Number of slots exposed by this container.
    • get

      ItemStack get(int slot)
      Returns the contents of the requested slot, never null.
      Throws:
      IndexOutOfBoundsException - if the slot is out of bounds
    • set

      void set(int slot, @Nullable ItemStack stack)
      Replaces the contents of a slot. A null is normalized to ItemStack.EMPTY.
      Throws:
      IndexOutOfBoundsException - if the slot is out of bounds
    • clear

      void clear()
      Clears every slot.
    • isEmpty

      boolean isEmpty()
      true if every slot is empty.