Interface ItemContainer

  • All Superinterfaces:
    Node

    public interface ItemContainer
    extends Node
    Represents an inventory that contains items.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean contains​(int itemId)
      Check if this item container contains the given item
      int count​(int itemId)
      Counts how many of an item this item container contains
      Item getItem​(int slot)
      Gets an item from the container at the given slot.
      Item[] getItems()
      Gets an array of all items in the container.
      int size()
      Get the number of items in this item container.
    • Method Detail

      • getItems

        @Nonnull
        Item[] getItems()
        Gets an array of all items in the container.
        Returns:
        the items held
      • getItem

        @Nullable
        Item getItem​(int slot)
        Gets an item from the container at the given slot.
        Parameters:
        slot -
        Returns:
        the item
        See Also:
        Item
      • contains

        boolean contains​(int itemId)
        Check if this item container contains the given item
        Parameters:
        itemId -
        Returns:
        See Also:
        ItemID
      • count

        int count​(int itemId)
        Counts how many of an item this item container contains
        Parameters:
        itemId -
        Returns:
        See Also:
        ItemID
      • size

        int size()
        Get the number of items in this item container. May include empty slots.
        Returns: