Package rs.kreme.ksbot.api.game
Class Lootable
- java.lang.Object
-
- rs.kreme.ksbot.api.game.Lootable
-
public class Lootable extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLootable.Priority
-
Field Summary
Fields Modifier and Type Field Description static booleanLOOT_FOODstatic booleanLOOT_PRAYER_POTIONS
-
Constructor Summary
Constructors Constructor Description Lootable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDrop(KSGroundItem item)Adds the quantity of a dropped item to the tracker.voidaddDrop(KSItem item)Adds the quantity of a dropped item to the tracker.voidaddItem(Lootable.Priority priority, int... items)Adds items by ID with a specified priority to the lootations map.voidaddItem(Lootable.Priority priority, java.lang.String... items)Adds items by name with a specified priority to the lootations map.booleancontains(int id)Checks if the lootations map contains the specified item by ID.booleancontains(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.PrioritygetPriority(KSGroundItem item)Retrieves the priority of a specific ground item.booleanpickup()Attempts to pick up the highest-priority item on the ground.booleanpickup(int... list)booleanpickup(java.lang.String... list)voidreset()Clears all items from the lootations map and resets flags.
-
-
-
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
DEFAULTif 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:
trueif 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:
trueif the item is in the lootations map.
-
pickup
public boolean pickup()
Attempts to pick up the highest-priority item on the ground.- Returns:
trueif an item was picked up,falseotherwise.
-
pickup
public boolean pickup(int... list)
-
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.
-
-