Class PrivGroundItem

java.lang.Object
privbot.wrappers.PrivGroundItem

public final class PrivGroundItem extends Object
Ground stack wrapper; interact("Take") routes through the game client.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    distanceTo(net.runelite.api.coords.WorldPoint p)
    Tile-step distance to p.
    boolean
    Whether this stack still appears on its tile (same id and quantity).
    int
    Alias for getQuantity() (DreamBot / Scar-style naming).
    int
    The item id, or -1 when built without a stack.
    int
    Same as getId() — convenient for price APIs that take an item id.
    The item name from ItemManager, or "item:<id>" when it cannot be resolved (always so without an ItemManager, the normal case on Impact, Elorin and SpawnPK).
    int
    The stack size captured when this wrapper was built.
    net.runelite.api.Tile
    Tile this stack sits on; may be null if constructed without a tile.
    net.runelite.api.coords.WorldPoint
    The stack's world tile, or null when built without a tile.
    boolean
    hasAction(String action)
    Ground loot typically exposes Take; matches Scar-style "pickup" too.
    boolean
    interact(String action)
    Dispatches a ground-item option on this stack.
    boolean
    Takes this item from the ground.

    Methods inherited from class java.lang.Object

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

    • getId

      public int getId()
      The item id, or -1 when built without a stack.
    • getItem

      public int getItem()
      Same as getId() — 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 for getQuantity() (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

      public String getName()
      The item name from ItemManager, 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 to p. Integer.MAX_VALUE on different planes, Double.MAX_VALUE when either location is unknown.
    • hasAction

      public boolean hasAction(String action)
      Ground loot typically exposes Take; 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

      public boolean interact(String action)
      Dispatches a ground-item option on this stack. Take/pickup map 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.