Class Lootable


  • public class Lootable
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Lootable.Priority  
    • Constructor Summary

      Constructors 
      Constructor Description
      Lootable()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDrop​(KSGroundItem item)
      Adds the quantity of a dropped item to the tracker.
      void addDrop​(KSItem item)
      Adds the quantity of a dropped item to the tracker.
      void addItem​(Lootable.Priority priority, int... items)
      Adds items by ID with a specified priority to the lootations map.
      void addItem​(Lootable.Priority priority, java.lang.String... items)
      Adds items by name with a specified priority to the lootations map.
      boolean contains​(int id)
      Checks if the lootations map contains the specified item by ID.
      boolean contains​(java.lang.String name)
      Checks if the lootations map contains the specified item by name.
      java.lang.String[] getItems()
      Retrieves all item names/IDs marked for looting.
      Lootable.Priority getPriority​(KSGroundItem item)
      Retrieves the priority of a specific ground item.
      boolean pickup()
      Attempts to pick up the highest-priority item on the ground.
      boolean pickup​(java.lang.String[] list)  
      void reset()
      Clears all items from the lootations map and resets flags.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOOT_FOOD

        public static boolean LOOT_FOOD
      • LOOT_PRAYER_POTIONS

        public static boolean LOOT_PRAYER_POTIONS
    • Constructor Detail

      • Lootable

        public Lootable()
    • Method Detail

      • getItems

        public java.lang.String[] getItems()
        Retrieves all item names/IDs marked for looting.
        Returns:
        Array of item names/IDs to loot.
      • addDrop

        public void addDrop​(KSGroundItem item)
        Adds the quantity of a dropped item to the tracker.
        Parameters:
        item - The ground item to track.
      • addDrop

        public void addDrop​(KSItem item)
        Adds the quantity of a dropped item to the tracker.
        Parameters:
        item - The ground item to track.
      • getPriority

        public Lootable.Priority getPriority​(KSGroundItem item)
        Retrieves the priority of a specific ground item.
        Parameters:
        item - The ground item to evaluate.
        Returns:
        The priority of the item, or DEFAULT if not specified.
      • contains

        public boolean contains​(int id)
        Checks if the lootations map contains the specified item by ID.
        Parameters:
        id - The item ID to check.
        Returns:
        true if the item is in the lootations map.
      • contains

        public boolean contains​(java.lang.String name)
        Checks if the lootations map contains the specified item by name.
        Parameters:
        name - The item name to check.
        Returns:
        true if the item is in the lootations map.
      • pickup

        public boolean pickup()
        Attempts to pick up the highest-priority item on the ground.
        Returns:
        true if an item was picked up, false otherwise.
      • pickup

        public boolean pickup​(java.lang.String[] list)
      • addItem

        public void addItem​(Lootable.Priority priority,
                            int... items)
        Adds items by ID with a specified priority to the lootations map.
        Parameters:
        priority - The priority level.
        items - Array of item IDs.
      • addItem

        public void addItem​(Lootable.Priority priority,
                            java.lang.String... items)
        Adds items by name with a specified priority to the lootations map.
        Parameters:
        priority - The priority level.
        items - Array of item names.
      • reset

        public void reset()
        Clears all items from the lootations map and resets flags.