Class RunePouch

java.lang.Object
net.storm.api.magic.RunePouch

public class RunePouch extends Object
Utility class for interacting with the Rune Pouch item.

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 Classes
    Modifier and Type
    Class
    Description
    static enum 
    Represents a slot within the Rune Pouch.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static IItem
    Gets the Rune Pouch item from the player's inventory.
    static int
    getQuantity(int itemId)
    Gets the quantity of a specific rune by its item ID.
    static int
    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.
    static List<Integer>
    Gets a list of all rune item IDs currently stored in the Rune Pouch.
    static boolean
    Checks if the player has a Rune Pouch in their inventory.
    static boolean
    Checks if the player has a Divine Rune Pouch.
    static boolean
    Checks if the Rune Pouch is empty.
    static boolean
    Checks if the Rune Pouch is full.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RunePouch

      public RunePouch()
  • Method Details

    • getQuantity

      public static int getQuantity(Rune rune)
      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

      public static IItem 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 IItem if found in inventory, or null if not present
    • hasPouch

      public static boolean hasPouch()
      Checks if the player has a Rune Pouch in their inventory.
      Returns:
      true if a Rune Pouch is in the inventory, false otherwise
    • 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:
      true if a Divine Rune Pouch is in the inventory, false otherwise
    • getRunes

      public static List<Integer> getRunes()
      Gets a list of all rune item IDs currently stored in the Rune Pouch.
      Returns:
      a List of item IDs for runes in the pouch
    • getRuneQuantities

      public static Map<Integer,Integer> getRuneQuantities()
      Gets a map of all runes in the Rune Pouch with their quantities.
      Returns:
      a Map where 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:
      true if all available slots contain runes, false otherwise
    • isEmpty

      public static boolean isEmpty()
      Checks if the Rune Pouch is empty.
      Returns:
      true if no runes are stored in the pouch, false otherwise