Package net.storm.sdk.items
Class Items
java.lang.Object
net.storm.sdk.items.Items
Static utility class for searching items across all item containers.
This class provides a unified interface to search for items across the inventory, equipment, bank, and bank inventory simultaneously. It is useful when you need to find an item regardless of where it is stored.
Example usage:
// Find an item anywhere (inventory, equipment, bank, bank inventory)
IItem item = Items.getFirst("Rune pickaxe");
// Check if player is carrying an item (inventory, equipment, or bank inventory)
if (Items.isCarrying("Tinderbox")) {
// Player has tinderbox on them
}
// Get all items with a specific name from all containers
List<IItem> allCoins = Items.getAll("Coins");
// Check if an item exists anywhere
if (Items.contains("Dragon bones")) {
// Item exists somewhere
}
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontains(int... id) Checks if any container has an item with any of the specified IDs.static booleanChecks if any container has an item with any of the specified names.static booleanChecks if any container has an item matching the filter.getAll(int... ids) Gets all items matching any of the specified IDs from all containers.Gets all items matching any of the specified names from all containers.Gets all items matching the filter from all containers (inventory, equipment, bank, bank inventory).getCarrying(int... ids) Gets all items the player is carrying with any of the specified IDs.getCarrying(String... names) Gets all items the player is carrying with any of the specified names.getCarrying(Predicate<? super IItem> filter) Gets all items the player is carrying matching the filter (inventory, equipment, bank inventory).static IItemgetFirst(int... ids) Gets the first item matching any of the specified IDs from any container.static IItemGets the first item matching any of the specified names from any container.static IItemGets the first item matching the filter from any container.static IItemgetLast(int... ids) Gets the last item matching any of the specified IDs from any container.static IItemGets the last item matching any of the specified names from any container.static IItemGets the last item matching the filter from any container (by slot index).static booleanisCarrying(int... ids) Checks if the player is carrying an item with any of the specified IDs.static booleanisCarrying(String... names) Checks if the player is carrying an item with any of the specified names.static booleanisCarrying(Predicate<? super IItem> filter) Checks if the player is carrying an item matching the filter (inventory or equipment).
-
Constructor Details
-
Items
public Items()
-
-
Method Details
-
getAll
Gets all items matching the filter from all containers (inventory, equipment, bank, bank inventory).- Parameters:
filter- the predicate to match items against- Returns:
- a list of all matching items from all containers
-
getAll
Gets all items matching any of the specified names from all containers.- Parameters:
names- the item names to search for- Returns:
- a list of all matching items from all containers
-
getAll
Gets all items matching any of the specified IDs from all containers.- Parameters:
ids- the item IDs to search for- Returns:
- a list of all matching items from all containers
-
getFirst
Gets the first item matching the filter from any container.- Parameters:
filter- the predicate to match items against- Returns:
- the first matching item, or null if none found
-
getFirst
Gets the first item matching any of the specified IDs from any container.- Parameters:
ids- the item IDs to search for- Returns:
- the first matching item, or null if none found
-
getFirst
Gets the first item matching any of the specified names from any container.- Parameters:
names- the item names to search for- Returns:
- the first matching item, or null if none found
-
getLast
Gets the last item matching the filter from any container (by slot index).- Parameters:
filter- the predicate to match items against- Returns:
- the last matching item, or null if none found
-
getLast
Gets the last item matching any of the specified IDs from any container.- Parameters:
ids- the item IDs to search for- Returns:
- the last matching item, or null if none found
-
getLast
Gets the last item matching any of the specified names from any container.- Parameters:
names- the item names to search for- Returns:
- the last matching item, or null if none found
-
isCarrying
Checks if the player is carrying an item matching the filter (inventory or equipment).This checks if the item is on the player's person, not in the bank.
- Parameters:
filter- the predicate to match items against- Returns:
- true if the player is carrying a matching item, false otherwise
-
isCarrying
Checks if the player is carrying an item with any of the specified names.- Parameters:
names- the item names to search for- Returns:
- true if the player is carrying a matching item, false otherwise
-
isCarrying
public static boolean isCarrying(int... ids) Checks if the player is carrying an item with any of the specified IDs.- Parameters:
ids- the item IDs to search for- Returns:
- true if the player is carrying a matching item, false otherwise
-
contains
Checks if any container has an item matching the filter.- Parameters:
filter- the predicate to match items against- Returns:
- true if a matching item exists in any container, false otherwise
-
contains
Checks if any container has an item with any of the specified names.- Parameters:
name- the item names to search for- Returns:
- true if a matching item exists in any container, false otherwise
-
contains
public static boolean contains(int... id) Checks if any container has an item with any of the specified IDs.- Parameters:
id- the item IDs to search for- Returns:
- true if a matching item exists in any container, false otherwise
-
getCarrying
Gets all items the player is carrying matching the filter (inventory, equipment, bank inventory).This includes items on the player's person and in the bank inventory panel (when bank is open), but excludes items stored in the main bank.
- Parameters:
filter- the predicate to match items against- Returns:
- a list of all matching items the player is carrying
-
getCarrying
Gets all items the player is carrying with any of the specified names.- Parameters:
names- the item names to search for- Returns:
- a list of all matching items the player is carrying
-
getCarrying
Gets all items the player is carrying with any of the specified IDs.- Parameters:
ids- the item IDs to search for- Returns:
- a list of all matching items the player is carrying
-