Module gomint.api

Interface Inventory

    • Method Detail

      • getItem

        ItemStack getItem​(int slot)
        Gets the item out of this inventory
        Parameters:
        slot - The slot which we want to lookup
        Returns:
        The item stack or null if the slot is empty
      • setItem

        void setItem​(int slot,
                     ItemStack itemStack)
        Set the item into the slot of this inventory
        Parameters:
        slot - The slot in which we want to set this item
        itemStack - The item which we want to set into that slot
      • addItem

        boolean addItem​(ItemStack itemStack)
        Add a item to the next free slot in this inventory
        Parameters:
        itemStack - which should be added to the inventory
        Returns:
        true if it was stored, false when not
      • size

        int size()
        Get the size of this inventory
        Returns:
        The size of this inventory
      • clear

        void clear()
        Set all items in this inventory to air
      • getViewers

        Collection<Entity> getViewers()
        Get a collection of all entities currently viewing this inventory
        Returns:
        collection of viewers
      • getInventoryType

        InventoryType getInventoryType()
        Get the type of this inventory
        Returns:
        type of inventory
      • getContents

        ItemStack[] getContents()
        Get the contents of this inventory
        Returns:
        array copy of item stacks, none of which can be null
      • contains

        boolean contains​(ItemStack itemStack)
        Check if the inventory holds an instance of the asked item stack
        Parameters:
        itemStack - which should be checked against
        Returns:
        true if inventory contains, false if not