Package rsb.methods
Class Equipment
java.lang.Object
rsb.methods.MethodProvider
rsb.methods.Equipment
Equipment related operations.
-
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsAll
(int... items) Checks whether the player has all of the given items equipped.boolean
containsOneOf
(int... items) Checks if the player has one (or more) of the given items equipped.RSItem[]
RSItem[]
Gets the cached equipment array (i.e.int
getCount()
Returns the number of items equipped excluding stack sizes.int
getCount
(int itemID) Returns the number of items matching a given ID equipped excluding stack sizes.Gets the equipment interface.getItem
(int index) Gets the equipment item at a given index.RSItem[]
getItems()
Gets the equipment array.
-
Method Details
-
getInterface
Gets the equipment interface.- Returns:
- the equipment interface
-
getItems
Gets the equipment array.- Returns:
- An array containing all equipped items
-
getCachedItems
Gets the cached equipment array (i.e. does not open the interface).- Returns:
- The items equipped as seen when the equipment tab was last opened.
-
getItem
Gets the equipment item at a given index.- Parameters:
index
- The item index.- Returns:
- The equipped item.
-
find
-
getCount
public int getCount()Returns the number of items equipped excluding stack sizes.- Returns:
- Amount of items currently equipped.
-
getCount
public int getCount(int itemID) Returns the number of items matching a given ID equipped excluding stack sizes.- Parameters:
itemID
- The item ID to count. Same as the equipment/item id in the inventory.- Returns:
- Amount of specified item currently equipped.
- See Also:
-
containsAll
public boolean containsAll(int... items) Checks whether the player has all of the given items equipped.- Parameters:
items
- The item ID to check for. Same as the equipment/item id in the inventory.- Returns:
true
if specified item is currently equipped; otherwisefalse
.- See Also:
-
containsOneOf
public boolean containsOneOf(int... items) Checks if the player has one (or more) of the given items equipped.- Parameters:
items
- The IDs of items to check for.- Returns:
true
if the player has one (or more) of the given items equipped; otherwisefalse
.
-