Class Bank.Inventory

java.lang.Object
net.storm.sdk.items.Bank.Inventory
Enclosing class:
Bank

public static class Bank.Inventory extends Object
Nested utility class for interacting with the inventory panel while the bank is open.

When the bank interface is open, the inventory is displayed in a separate panel. This class provides methods to query and interact with items in that inventory view.

Example usage:


 // Get all items in inventory while bank is open
 List<IBankInventoryItem> items = Bank.Inventory.getAll();

 // Check if inventory contains an item
 if (Bank.Inventory.contains("Lobster")) {
     IBankInventoryItem lobster = Bank.Inventory.getFirst("Lobster");
     // Can deposit this item
 }
 

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    contains(int... id)
    Checks if the bank inventory panel contains any item matching any of the specified IDs.
    static boolean
    contains(String... name)
    Checks if the bank inventory panel contains any item matching any of the specified names.
    static boolean
    contains(Predicate<? super IItem> filter)
    Checks if the bank inventory panel contains any item matching the filter.
    static boolean
    containsAll(int... ids)
    Checks if the bank inventory panel contains all items with the specified IDs.
    static boolean
    containsAll(String... names)
    Checks if the bank inventory panel contains all items with the specified names.
    Gets all items in the bank inventory panel.
    getAll(int... ids)
    Gets all items in the bank inventory panel matching any of the specified IDs.
    getAll(String... names)
    Gets all items in the bank inventory panel matching any of the specified names.
    getAll(Predicate<? super IItem> filter)
    Gets all items in the bank inventory panel matching the filter.
    static int
    getCount(boolean stacks, int... ids)
    Counts items in the bank inventory panel matching any of the specified IDs.
    static int
    getCount(boolean stacks, String... names)
    Counts items in the bank inventory panel matching any of the specified names.
    static int
    getCount(boolean stacks, Predicate<? super IItem> filter)
    Counts items in the bank inventory panel matching the filter.
    static int
    getCount(int... ids)
    Counts the number of item stacks matching any of the specified IDs.
    static int
    getCount(String... names)
    Counts the number of item stacks matching any of the specified names.
    static int
    getCount(Predicate<? super IItem> filter)
    Counts the number of item stacks matching the filter.
    getFirst(int... ids)
    Gets the first item in the bank inventory panel matching any of the specified IDs.
    getFirst(String... names)
    Gets the first item in the bank inventory panel matching any of the specified names.
    getFirst(Predicate<? super IItem> filter)
    Gets the first item in the bank inventory panel matching the filter.
    getLast(int... ids)
    Gets the last item in the bank inventory panel matching any of the specified IDs.
    getLast(String... names)
    Gets the last item in the bank inventory panel matching any of the specified names.
    getLast(Predicate<? super IItem> filter)
    Gets the last item in the bank inventory panel matching the filter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Inventory

      public Inventory()
  • Method Details

    • getAll

      public static List<IBankInventoryItem> getAll()
      Gets all items in the bank inventory panel.
      Returns:
      a list of all items in the inventory
    • getAll

      public static List<IBankInventoryItem> getAll(Predicate<? super IItem> filter)
      Gets all items in the bank inventory panel matching the filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      a list of matching items
    • getAll

      public static List<IBankInventoryItem> getAll(int... ids)
      Gets all items in the bank inventory panel matching any of the specified IDs.
      Parameters:
      ids - the item IDs to search for
      Returns:
      a list of matching items
    • getAll

      public static List<IBankInventoryItem> getAll(String... names)
      Gets all items in the bank inventory panel matching any of the specified names.
      Parameters:
      names - the item names to search for
      Returns:
      a list of matching items
    • getFirst

      public static IBankInventoryItem getFirst(Predicate<? super IItem> filter)
      Gets the first item in the bank inventory panel matching the filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      the first matching item, or null if none found
    • getFirst

      public static IBankInventoryItem getFirst(int... ids)
      Gets the first item in the bank inventory panel matching any of the specified IDs.
      Parameters:
      ids - the item IDs to search for
      Returns:
      the first matching item, or null if none found
    • getFirst

      public static IBankInventoryItem getFirst(String... names)
      Gets the first item in the bank inventory panel matching any of the specified names.
      Parameters:
      names - the item names to search for
      Returns:
      the first matching item, or null if none found
    • getLast

      public static IBankInventoryItem getLast(Predicate<? super IItem> filter)
      Gets the last item in the bank inventory panel matching the filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      the last matching item, or null if none found
    • getLast

      public static IBankInventoryItem getLast(int... ids)
      Gets the last item in the bank inventory panel matching any of the specified IDs.
      Parameters:
      ids - the item IDs to search for
      Returns:
      the last matching item, or null if none found
    • getLast

      public static IBankInventoryItem getLast(String... names)
      Gets the last item in the bank inventory panel matching any of the specified names.
      Parameters:
      names - the item names to search for
      Returns:
      the last matching item, or null if none found
    • getCount

      public static int getCount(boolean stacks, Predicate<? super IItem> filter)
      Counts items in the bank inventory panel matching the filter.
      Parameters:
      stacks - if true, counts the total quantity of stacked items; if false, counts number of stacks
      filter - the predicate to match items against
      Returns:
      the count of matching items
    • getCount

      public static int getCount(boolean stacks, int... ids)
      Counts items in the bank inventory panel matching any of the specified IDs.
      Parameters:
      stacks - if true, counts the total quantity of stacked items; if false, counts number of stacks
      ids - the item IDs to count
      Returns:
      the count of matching items
    • getCount

      public static int getCount(boolean stacks, String... names)
      Counts items in the bank inventory panel matching any of the specified names.
      Parameters:
      stacks - if true, counts the total quantity of stacked items; if false, counts number of stacks
      names - the item names to count
      Returns:
      the count of matching items
    • getCount

      public static int getCount(Predicate<? super IItem> filter)
      Counts the number of item stacks matching the filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      the number of matching item stacks
    • getCount

      public static int getCount(int... ids)
      Counts the number of item stacks matching any of the specified IDs.
      Parameters:
      ids - the item IDs to count
      Returns:
      the number of matching item stacks
    • getCount

      public static int getCount(String... names)
      Counts the number of item stacks matching any of the specified names.
      Parameters:
      names - the item names to count
      Returns:
      the number of matching item stacks
    • contains

      public static boolean contains(Predicate<? super IItem> filter)
      Checks if the bank inventory panel contains any item matching the filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      true if at least one matching item exists, false otherwise
    • contains

      public static boolean contains(String... name)
      Checks if the bank inventory panel contains any item matching any of the specified names.
      Parameters:
      name - the item names to search for
      Returns:
      true if at least one matching item exists, false otherwise
    • contains

      public static boolean contains(int... id)
      Checks if the bank inventory panel contains any item matching any of the specified IDs.
      Parameters:
      id - the item IDs to search for
      Returns:
      true if at least one matching item exists, false otherwise
    • containsAll

      public static boolean containsAll(int... ids)
      Checks if the bank inventory panel contains all items with the specified IDs.
      Parameters:
      ids - the item IDs that must all be present
      Returns:
      true if all items are present, false if any are missing
    • containsAll

      public static boolean containsAll(String... names)
      Checks if the bank inventory panel contains all items with the specified names.
      Parameters:
      names - the item names that must all be present
      Returns:
      true if all items are present, false if any are missing