Interface IInventoryAPI


  • public interface IInventoryAPI
    • Method Detail

      • getItemWidget

        ItemWidget getItemWidget​(int index)
        Gets the item widget at the given index. Also works for slots with no item.
        Parameters:
        index - the slot index
        Returns:
        the item widget or null if the index is invalid
      • getItems

        java.util.List<ItemWidget> getItems​(int... ids)
      • getItems

        java.util.List<ItemWidget> getItems​(java.lang.String... names)
      • getItems

        java.util.List<ItemWidget> getItems​(java.util.function.Predicate<Item> filter)
      • getItem

        ItemWidget getItem​(java.lang.String... names)
      • getItem

        ItemWidget getItem​(java.util.function.Predicate<Item> filter)
      • isItemSelected

        boolean isItemSelected()
      • getSelectedItemId

        int getSelectedItemId()
      • getSelectedItemName

        java.lang.String getSelectedItemName()
      • getSelectedItemIndex

        int getSelectedItemIndex()
      • getCount

        int getCount()
      • getCount

        int getCount​(int... ids)
      • getCount

        int getCount​(java.lang.String... names)
      • getCount

        int getCount​(boolean includeStackables,
                     int... ids)
      • getCount

        int getCount​(boolean includeStackables,
                     java.lang.String... names)
      • getCount

        int getCount​(boolean includeStackables)
      • getCount

        int getCount​(java.util.function.Predicate<Item> filter)
      • getCount

        int getCount​(boolean includeStackables,
                     java.util.function.Predicate<Item> filter)
      • isFull

        boolean isFull()
      • isEmpty

        boolean isEmpty()
      • getEmptySlotCount

        int getEmptySlotCount()
      • contains

        boolean contains​(int... ids)
      • contains

        boolean contains​(java.lang.String... names)
      • contains

        boolean contains​(java.util.function.Predicate<Item> filter)
      • containsAll

        boolean containsAll​(int... ids)
      • containsAll

        boolean containsAll​(java.lang.String... names)
      • onlyContains

        boolean onlyContains​(int... ids)
      • onlyContains

        boolean onlyContains​(java.lang.String... names)
      • onlyContains

        boolean onlyContains​(java.util.function.Predicate<Item> filter)
      • selectItem

        boolean selectItem​(int... ids)
      • selectItem

        boolean selectItem​(java.lang.String... names)
      • selectItem

        boolean selectItem​(java.util.function.Predicate<Item> filter)
      • dropItem

        boolean dropItem​(int... ids)
      • dropItem

        boolean dropItem​(java.lang.String... names)
      • dropItem

        boolean dropItem​(java.util.function.Predicate<Item> filter)
      • dropAll

        boolean dropAll()
      • dropAll

        boolean dropAll​(int... ids)
      • dropAll

        boolean dropAll​(java.lang.String... names)
      • dropAll

        boolean dropAll​(java.util.function.Predicate<Item> filter)
      • dropAllExcept

        boolean dropAllExcept​(int... ids)
      • dropAllExcept

        boolean dropAllExcept​(java.lang.String... names)
      • dropAllExcept

        boolean dropAllExcept​(java.util.function.Predicate<Item> filter)
      • interactItem

        boolean interactItem​(java.lang.String action,
                             int... ids)
      • interactItem

        boolean interactItem​(java.lang.String action,
                             java.lang.String... names)
      • interactItem

        boolean interactItem​(java.lang.String action,
                             java.util.function.Predicate<Item> filter)
      • deselectItem

        boolean deselectItem()
      • moveItem

        default boolean moveItem​(ItemWidget item,
                                 int slotIndex)
        Move the item to the given slot.
        Parameters:
        item - the item to move
        slotIndex - the index of the target slot
        Returns:
        true if successful, false otherwise
      • moveItem

        boolean moveItem​(int fromIndex,
                         int toIndex)
        Move the item to the given slot.
        Parameters:
        fromIndex - the slot index of the item to move
        toIndex - the index of the target slot
        Returns:
        true if successful, false otherwise