Class PrivGroundItem
java.lang.Object
privbot.wrappers.PrivGroundItem
Ground stack wrapper;
interact("Take") routes through the game client.-
Method Summary
Modifier and TypeMethodDescriptiondoubledistanceTo(net.runelite.api.coords.WorldPoint p) Tile-step distance top.booleanexists()Whether this stack still appears on its tile (same id and quantity).intAlias forgetQuantity()(DreamBot / Scar-style naming).intgetId()The item id, or -1 when built without a stack.intgetItem()Same asgetId()— convenient for price APIs that take an item id.getName()The item name fromItemManager, or"item:<id>"when it cannot be resolved (always so without an ItemManager, the normal case on Impact, Elorin and SpawnPK).intThe stack size captured when this wrapper was built.net.runelite.api.TilegetTile()Tile this stack sits on; may be null if constructed without a tile.net.runelite.api.coords.WorldPointThe stack's world tile, or null when built without a tile.booleanGround loot typically exposesTake; matches Scar-style"pickup"too.booleanDispatches a ground-item option on this stack.booleantake()Takes this item from the ground.
-
Method Details
-
getId
public int getId()The item id, or -1 when built without a stack. -
getItem
public int getItem()Same asgetId()— convenient for price APIs that take an item id. -
getQuantity
public int getQuantity()The stack size captured when this wrapper was built. -
getAmount
public int getAmount()Alias forgetQuantity()(DreamBot / Scar-style naming). -
getTile
public net.runelite.api.Tile getTile()Tile this stack sits on; may be null if constructed without a tile. -
getWorldLocation
public net.runelite.api.coords.WorldPoint getWorldLocation()The stack's world tile, or null when built without a tile. -
getName
The item name fromItemManager, or"item:<id>"when it cannot be resolved (always so without an ItemManager, the normal case on Impact, Elorin and SpawnPK). The lookup is not marshalled. -
distanceTo
public double distanceTo(net.runelite.api.coords.WorldPoint p) Tile-step distance top.Integer.MAX_VALUEon different planes,Double.MAX_VALUEwhen either location is unknown. -
hasAction
Ground loot typically exposesTake; matches Scar-style"pickup"too. -
exists
public boolean exists()Whether this stack still appears on its tile (same id and quantity). Reads the tile live, so call it from the client thread or immediately after a snapshot; a stack whose quantity changed reads as gone. -
interact
Dispatches a ground-item option on this stack.Take/pickupmap to the take option; anything else is sent as the second option. Not marshalled: the adapter dispatches on the calling thread.- Parameters:
action- e.g.Take- Returns:
- true when the action was dispatched, not proof of pickup: confirm by the inventory
count or
exists(). False for a missing action, adapter or item id.
-
take
public boolean take()Takes this item from the ground.
-