Class RunePouch
The Rune Pouch is a container item that can hold up to 3 different types of runes (or 4 types for the Divine Rune Pouch). This class provides methods to query the contents of the pouch, check its state, and retrieve rune quantities.
The pouch contents are stored in game variables (varbits) which this class reads to determine what runes are stored and their quantities.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents a slot within the Rune Pouch. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IItemgetPouch()Gets the Rune Pouch item from the player's inventory.static intgetQuantity(int itemId) Gets the quantity of a specific rune by its item ID.static intgetQuantity(Rune rune) Gets the quantity of a specific rune type stored in the Rune Pouch.Gets a map of all runes in the Rune Pouch with their quantities.getRunes()Gets a list of all rune item IDs currently stored in the Rune Pouch.static booleanhasPouch()Checks if the player has a Rune Pouch in their inventory.static booleanisDivine()Checks if the player has a Divine Rune Pouch.static booleanisEmpty()Checks if the Rune Pouch is empty.static booleanisFull()Checks if the Rune Pouch is full.
-
Constructor Details
-
RunePouch
public RunePouch()
-
-
Method Details
-
getQuantity
Gets the quantity of a specific rune type stored in the Rune Pouch.This method searches through all slots of the Rune Pouch to find the specified rune type. It also considers combination runes that can substitute for the requested rune.
- Parameters:
rune- the type of rune to check for- Returns:
- the quantity of the specified rune in the pouch, or 0 if not present or no pouch
-
getPouch
Gets the Rune Pouch item from the player's inventory.This method searches for any variant of the Rune Pouch including the standard Rune Pouch and Divine Rune Pouch.
- Returns:
- the Rune Pouch
IItemif found in inventory, ornullif not present
-
hasPouch
public static boolean hasPouch()Checks if the player has a Rune Pouch in their inventory.- Returns:
trueif a Rune Pouch is in the inventory,falseotherwise
-
isDivine
public static boolean isDivine()Checks if the player has a Divine Rune Pouch.The Divine Rune Pouch has 4 slots instead of the standard 3.
- Returns:
trueif a Divine Rune Pouch is in the inventory,falseotherwise
-
getRunes
Gets a list of all rune item IDs currently stored in the Rune Pouch.- Returns:
- a
Listof item IDs for runes in the pouch
-
getRuneQuantities
Gets a map of all runes in the Rune Pouch with their quantities.- Returns:
- a
Mapwhere keys are rune item IDs and values are quantities
-
getQuantity
public static int getQuantity(int itemId) Gets the quantity of a specific rune by its item ID.- Parameters:
itemId- the item ID of the rune to check- Returns:
- the quantity of that rune in the pouch, or 0 if not present
-
isFull
public static boolean isFull()Checks if the Rune Pouch is full.A standard Rune Pouch is full with 3 different rune types. A Divine Rune Pouch is full with 4 different rune types.
- Returns:
trueif all available slots contain runes,falseotherwise
-
isEmpty
public static boolean isEmpty()Checks if the Rune Pouch is empty.- Returns:
trueif no runes are stored in the pouch,falseotherwise
-