Package net.storm.sdk.items
Class Bank.Inventory
java.lang.Object
net.storm.sdk.items.Bank.Inventory
- Enclosing class:
Bank
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontains(int... id) Checks if the bank inventory panel contains any item matching any of the specified IDs.static booleanChecks if the bank inventory panel contains any item matching any of the specified names.static booleanChecks if the bank inventory panel contains any item matching the filter.static booleancontainsAll(int... ids) Checks if the bank inventory panel contains all items with the specified IDs.static booleancontainsAll(String... names) Checks if the bank inventory panel contains all items with the specified names.static List<IBankInventoryItem> getAll()Gets all items in the bank inventory panel.static List<IBankInventoryItem> getAll(int... ids) Gets all items in the bank inventory panel matching any of the specified IDs.static List<IBankInventoryItem> Gets all items in the bank inventory panel matching any of the specified names.static List<IBankInventoryItem> Gets all items in the bank inventory panel matching the filter.static intgetCount(boolean stacks, int... ids) Counts items in the bank inventory panel matching any of the specified IDs.static intCounts items in the bank inventory panel matching any of the specified names.static intCounts items in the bank inventory panel matching the filter.static intgetCount(int... ids) Counts the number of item stacks matching any of the specified IDs.static intCounts the number of item stacks matching any of the specified names.static intCounts the number of item stacks matching the filter.static IBankInventoryItemgetFirst(int... ids) Gets the first item in the bank inventory panel matching any of the specified IDs.static IBankInventoryItemGets the first item in the bank inventory panel matching any of the specified names.static IBankInventoryItemGets the first item in the bank inventory panel matching the filter.static IBankInventoryItemgetLast(int... ids) Gets the last item in the bank inventory panel matching any of the specified IDs.static IBankInventoryItemGets the last item in the bank inventory panel matching any of the specified names.static IBankInventoryItemGets the last item in the bank inventory panel matching the filter.
-
Constructor Details
-
Inventory
public Inventory()
-
-
Method Details
-
getAll
Gets all items in the bank inventory panel.- Returns:
- a list of all items in the inventory
-
getAll
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
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
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
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
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
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
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
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
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
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 stacksfilter- 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 stacksids- the item IDs to count- Returns:
- the count of matching items
-
getCount
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 stacksnames- the item names to count- Returns:
- the count of matching items
-
getCount
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
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
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
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
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
-