Enum RunePouch
- java.lang.Object
-
- java.lang.Enum<RunePouch>
-
- com.kraken.api.service.magic.rune.RunePouch
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DIVINE_RUNE_POUCHDIVINE_RUNE_POUCH_LRUNE_POUCHRUNE_POUCH_LRUNE_POUCH_LMS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RunePouchbyItemId(int itemId)Retrieves the @code RunePouch instance corresponding to the specified item ID.static java.util.Map<Rune,java.lang.Integer>getBaseRunePouchContents()Retrieves the base contents of the rune pouch, converting any combination runes into their respective basic elemental runes.static RunePouchgetRunePouch()Retrieves theRunePouchinstance corresponding to a rune pouch currently present in the player's inventory.static java.util.Map<Rune,java.lang.Integer>getRunePouchContents()Retrieves the current contents of the rune pouch if one is present in the player's inventory.static booleanhasRunePouch()static RunePouchvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static RunePouch[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RUNE_POUCH
public static final RunePouch RUNE_POUCH
-
DIVINE_RUNE_POUCH
public static final RunePouch DIVINE_RUNE_POUCH
-
DIVINE_RUNE_POUCH_L
public static final RunePouch DIVINE_RUNE_POUCH_L
-
RUNE_POUCH_L
public static final RunePouch RUNE_POUCH_L
-
RUNE_POUCH_LMS
public static final RunePouch RUNE_POUCH_LMS
-
-
Method Detail
-
values
public static RunePouch[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RunePouch c : RunePouch.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RunePouch valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getRunePouch
public static RunePouch getRunePouch()
Retrieves theRunePouchinstance corresponding to a rune pouch currently present in the player's inventory. This checks all available rune pouch variants and returns the matching instance if any are found.- Returns:
- The
RunePouchcorresponding to a pouch found in the player's inventory, ornullif no matching pouch exists.
-
hasRunePouch
public static boolean hasRunePouch()
-
byItemId
public static RunePouch byItemId(int itemId)
Retrieves the @code RunePouch instance corresponding to the specified item ID. This method searches through all defined @code RunePouch values and returns the matching instance if the provided item ID corresponds to a known Rune Pouch.Returns @code null if no @code RunePouch with the given item ID is found.
- Parameters:
itemId- The item ID of the Rune Pouch to locate. This should be an integer representing a valid item ID of a Rune Pouch. For example, these may include IDs for standard, divine, or decorative Rune Pouches.- Returns:
- The @code RunePouch instance matching the given item ID, or @code null if no match is found.
-
getBaseRunePouchContents
public static java.util.Map<Rune,java.lang.Integer> getBaseRunePouchContents()
Retrieves the base contents of the rune pouch, converting any combination runes into their respective basic elemental runes.This method first obtains the current contents of the rune pouch through
getRunePouchContents(). If any combination runes are present in the pouch, they are decomposed into their corresponding base runes (e.g., a Dust Rune is split into both Air and Earth Runes). The output is a flattened mapping containing all base runes and their counts, ensuring that combination runes are fully represented by their components.Note: The quantity of each base rune will match the total quantity of the combination rune that produces it.
- If the rune pouch contains only non-combination runes, the result will be identical to the
original mapping from
getRunePouchContents(). - If the rune pouch contains a combination rune, all its base components will be added to the returned map with identical counts.
- If the rune pouch is empty or the player does not have a rune pouch, an empty map is returned.
- Returns:
- A
Map<Rune, Integer>where:- The key is a
Runeinstance representing a base rune included in the pouch contents. - The value is an
Integerrepresenting the quantity of that rune.
- The key is a
- If the rune pouch contains only non-combination runes, the result will be identical to the
original mapping from
-
getRunePouchContents
public static java.util.Map<Rune,java.lang.Integer> getRunePouchContents()
Retrieves the current contents of the rune pouch if one is present in the player's inventory.The rune pouch can hold up to three types of runes, each represented by a
Runeobject and its corresponding count. This method checks if a rune pouch is available, determines the runes contained within it, and returns a mapping of runes to their quantities.- If no rune pouch is found in the player's inventory, an empty map is returned.
- If a rune pouch exists, the method queries the item definitions and in-game variables (varbits) to determine the specific runes and their counts.
- Returns:
- A
Map<Rune, Integer>where:- The key is a
Runeinstance representing a type of rune stored in the pouch. - The value is an
Integerrepresenting the quantity of that rune.
- The key is a
-
-