Interface IInventoryAPI


public interface IInventoryAPI
  • Field Details

  • Method Details

    • 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

      List<ItemWidget> getItems()
    • getItems

      List<ItemWidget> getItems(int... ids)
    • getItems

      List<ItemWidget> getItems(String... names)
    • getItems

      List<ItemWidget> getItems(Predicate<Item> filter)
    • getItem

      ItemWidget getItem(int... ids)
    • getItem

      ItemWidget getItem(String... names)
    • getItem

      ItemWidget getItem(Predicate<Item> filter)
    • getItemAt

      ItemWidget getItemAt(int index)
    • isItemSelected

      boolean isItemSelected()
    • getSelectedItemId

      int getSelectedItemId()
    • getSelectedItemName

      String getSelectedItemName()
    • getSelectedItemIndex

      int getSelectedItemIndex()
    • getSelectedItem

      ItemWidget getSelectedItem()
    • getCount

      int getCount()
    • getCount

      int getCount(int... ids)
    • getCount

      int getCount(String... names)
    • getCount

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

      int getCount(boolean includeStackables, String... names)
    • getCount

      int getCount(boolean includeStackables)
    • getCount

      int getCount(Predicate<Item> filter)
    • getCount

      int getCount(boolean includeStackables, Predicate<Item> filter)
    • isFull

      boolean isFull()
    • isEmpty

      boolean isEmpty()
    • getEmptySlotCount

      int getEmptySlotCount()
    • contains

      boolean contains(int... ids)
    • contains

      boolean contains(String... names)
    • contains

      boolean contains(Predicate<Item> filter)
    • containsAll

      boolean containsAll(int... ids)
    • containsAll

      boolean containsAll(String... names)
    • onlyContains

      boolean onlyContains(int... ids)
    • onlyContains

      boolean onlyContains(String... names)
    • onlyContains

      boolean onlyContains(Predicate<Item> filter)
    • selectItem

      boolean selectItem(int... ids)
    • selectItem

      boolean selectItem(String... names)
    • selectItem

      boolean selectItem(Predicate<Item> filter)
    • dropItem

      boolean dropItem(int... ids)
    • dropItem

      boolean dropItem(String... names)
    • dropItem

      boolean dropItem(Predicate<Item> filter)
    • dropItem

      boolean dropItem(ItemWidget item)
    • dropAll

      boolean dropAll()
    • dropAll

      boolean dropAll(int... ids)
    • dropAll

      boolean dropAll(String... names)
    • dropAll

      boolean dropAll(Predicate<Item> filter)
    • dropAllExcept

      boolean dropAllExcept(int... ids)
    • dropAllExcept

      boolean dropAllExcept(String... names)
    • dropAllExcept

      boolean dropAllExcept(Predicate<Item> filter)
    • interactItem

      boolean interactItem(String action, int... ids)
    • interactItem

      boolean interactItem(String action, String... names)
    • interactItem

      boolean interactItem(String action, 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
    • query

    • getAll

      List<ItemWidget> getAll(ItemWidgetQueryRequest itemWidgetQueryRequest)