Package net.storm.sdk.items
Class Equipment
java.lang.Object
net.storm.sdk.items.Equipment
Static utility class for accessing and interacting with the player's equipped items.
Equipment refers to items worn in equipment slots such as head, cape, amulet, weapon, body, shield, legs, gloves, boots, ring, and ammunition. This class provides methods to query equipped items and check what the player is wearing.
Example usage:
// Check if player has a weapon equipped
IItem weapon = Equipment.fromSlot(EquipmentSlot.WEAPON);
if (weapon != null) {
System.out.println("Wielding: " + weapon.getName());
}
// Check if wearing specific armor
if (Equipment.contains("Dragon platebody")) {
// Player is wearing dragon platebody
}
// Get all equipped items
List<IItem> equipped = Equipment.getAll();
// Check if wearing full set
if (Equipment.containsAll("Dragon helm", "Dragon platebody", "Dragon platelegs")) {
// Player has full dragon armor
}
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontains(int... id) Checks if the player has any equipped item matching any of the specified IDs.static booleanChecks if the player has any equipped item matching any of the specified names.static booleanChecks if the player has any equipped item matching the specified filter.static booleancontainsAll(int... ids) Checks if the player has all items with the specified IDs equipped.static booleancontainsAll(String... names) Checks if the player has all items with the specified names equipped.static booleancontainsAll(Predicate<? super IItem> filter) Checks if all equipped items match the specified filter.static IItemfromSlot(EquipmentSlot slot) Gets the item equipped in the specified equipment slot.static IItemget(int slot) Gets the equipped item at the specified slot index.getAll()Gets all currently equipped items.getAll(int... ids) Gets all equipped items matching any of the specified IDs.Gets all equipped items matching any of the specified names.Gets all equipped items matching the specified filter.static intgetCount(boolean stacks, int... ids) Counts equipped items matching any of the specified IDs.static intCounts equipped items matching any of the specified names.static intCounts equipped items matching the filter.static intgetCount(int... ids) Counts the number of equipment slots occupied by items matching any of the specified IDs.static intCounts the number of equipment slots occupied by items matching any of the specified names.static intCounts the number of equipment slots occupied by items matching the filter.static IItemgetFirst(int... ids) Gets the first equipped item matching any of the specified IDs.static IItemGets the first equipped item matching any of the specified names.static IItemGets the first equipped item matching the specified filter.static IItemgetLast(int... ids) Gets the last equipped item matching any of the specified IDs.static IItemGets the last equipped item matching any of the specified names.static IItemGets the last equipped item matching the specified filter.
-
Constructor Details
-
Equipment
public Equipment()
-
-
Method Details
-
fromSlot
Gets the item equipped in the specified equipment slot.- Parameters:
slot- the equipment slot to check- Returns:
- the item in the slot, or null if the slot is empty
-
getAll
Gets all equipped items matching the specified filter.- Parameters:
filter- the predicate to match items against- Returns:
- a list of matching equipped items
-
getAll
Gets all equipped items matching any of the specified IDs.- Parameters:
ids- the item IDs to search for- Returns:
- a list of matching equipped items
-
getAll
Gets all equipped items matching any of the specified names.- Parameters:
names- the item names to search for- Returns:
- a list of matching equipped items
-
getAll
Gets all currently equipped items.- Returns:
- a list of all equipped items
-
get
Gets the equipped item at the specified slot index.- Parameters:
slot- the slot index- Returns:
- the item at the slot, or null if empty
-
getFirst
Gets the first equipped item matching the specified filter.- Parameters:
filter- the predicate to match items against- Returns:
- the first matching equipped item, or null if none found
-
getFirst
Gets the first equipped item matching any of the specified IDs.- Parameters:
ids- the item IDs to search for- Returns:
- the first matching equipped item, or null if none found
-
getFirst
Gets the first equipped item matching any of the specified names.- Parameters:
names- the item names to search for- Returns:
- the first matching equipped item, or null if none found
-
getLast
Gets the last equipped item matching the specified filter.- Parameters:
filter- the predicate to match items against- Returns:
- the last matching equipped item, or null if none found
-
getLast
Gets the last equipped item matching any of the specified IDs.- Parameters:
ids- the item IDs to search for- Returns:
- the last matching equipped item, or null if none found
-
getLast
Gets the last equipped item matching any of the specified names.- Parameters:
names- the item names to search for- Returns:
- the last matching equipped item, or null if none found
-
getCount
Counts equipped items matching the filter.- Parameters:
stacks- if true, counts the total quantity (e.g., arrows); if false, counts number of slotsfilter- the predicate to match items against- Returns:
- the count of matching items
-
getCount
public static int getCount(boolean stacks, int... ids) Counts equipped items matching any of the specified IDs.- Parameters:
stacks- if true, counts the total quantity (e.g., arrows); if false, counts number of slotsids- the item IDs to count- Returns:
- the count of matching items
-
getCount
Counts equipped items matching any of the specified names.- Parameters:
stacks- if true, counts the total quantity (e.g., arrows); if false, counts number of slotsnames- the item names to count- Returns:
- the count of matching items
-
getCount
Counts the number of equipment slots occupied by items matching the filter.- Parameters:
filter- the predicate to match items against- Returns:
- the number of matching slots
-
getCount
public static int getCount(int... ids) Counts the number of equipment slots occupied by items matching any of the specified IDs.- Parameters:
ids- the item IDs to count- Returns:
- the number of matching slots
-
getCount
Counts the number of equipment slots occupied by items matching any of the specified names.- Parameters:
names- the item names to count- Returns:
- the number of matching slots
-
contains
Checks if the player has any equipped item matching the specified filter.- Parameters:
filter- the predicate to match items against- Returns:
- true if at least one matching item is equipped, false otherwise
-
contains
public static boolean contains(int... id) Checks if the player has any equipped item matching any of the specified IDs.- Parameters:
id- the item IDs to search for- Returns:
- true if at least one matching item is equipped, false otherwise
-
contains
Checks if the player has any equipped item matching any of the specified names.- Parameters:
name- the item names to search for- Returns:
- true if at least one matching item is equipped, false otherwise
-
containsAll
public static boolean containsAll(int... ids) Checks if the player has all items with the specified IDs equipped.- Parameters:
ids- the item IDs that must all be equipped- Returns:
- true if all items are equipped, false if any are missing
-
containsAll
Checks if the player has all items with the specified names equipped.- Parameters:
names- the item names that must all be equipped- Returns:
- true if all items are equipped, false if any are missing
-
containsAll
Checks if all equipped items match the specified filter.- Parameters:
filter- the predicate that all equipped items must match- Returns:
- true if all equipped items match the filter, false otherwise
-