Class PrivObject

java.lang.Object
privbot.wrappers.PrivObject

public final class PrivObject extends Object
Scene object wrapper; interactions go through the game client.

Wraps the live client TileObject. Definition reads (getName(), getActions(), hasAction(String)) resolve the object's current transform and should run on the client thread; interact(String), exists() and the localPlayer*Of checks marshal through GameThread.ensure(java.util.function.Supplier<T>, T) themselves.

  • Method Summary

    Modifier and Type
    Method
    Description
    double
    distanceTo(net.runelite.api.coords.WorldPoint p)
    Tile-step (Chebyshev) distance to p, ignoring the plane (see the note in the body); Double.MAX_VALUE when either location is unknown.
    boolean
    True if a scene object with the same id still exists at this tile (refreshed scan).
    A copy of the transformed definition's raw action array (tags not stripped, null entries kept).
    int
    The object's scene id (before any varbit transform), or -1 without an object.
    The transformed definition's name with tags stripped, or "object:<id>" when the definition cannot be read.
    net.runelite.api.TileObject
    The wrapped client object (may be null).
    net.runelite.api.coords.WorldPoint
    The object's world tile, or null when unknown.
    boolean
    hasAction(String action)
    Whether the object definition exposes this action (e.g.
    boolean
    Like hasAction(String) but, when the varbit-resolved composition has no matching action, also checks every distinct template id on the base definition (base id + ObjectComposition.getImpostorIds()).
    boolean
    interact(String action)
    Resolves the menu entry by name (e.g.
    boolean
    interact(String action, boolean walkOntoObject)
     
    boolean
    True if the local player is strictly east of this object (higher X).
    boolean
    True if the logged-in player's tile is strictly north of this object's tile (higher map Y, same plane).
    boolean
    True if the local player is strictly south of this object (lower Y).
    boolean
    True if the local player is strictly west of this object (lower X).
    net.runelite.api.Point
    The scene tile an interaction with this object is dispatched against (menu param0/param1).

    Methods inherited from class java.lang.Object

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

    • getTileObject

      public net.runelite.api.TileObject getTileObject()
      The wrapped client object (may be null). Raw reads on it are not marshalled.
    • getId

      public int getId()
      The object's scene id (before any varbit transform), or -1 without an object.
    • getWorldLocation

      public net.runelite.api.coords.WorldPoint getWorldLocation()
      The object's world tile, or null when unknown.
    • getName

      public String getName()
      The transformed definition's name with tags stripped, or "object:<id>" when the definition cannot be read. Empty only without an object or client.
    • distanceTo

      public double distanceTo(net.runelite.api.coords.WorldPoint p)
      Tile-step (Chebyshev) distance to p, ignoring the plane (see the note in the body); Double.MAX_VALUE when either location is unknown.
    • localPlayerNorthOf

      public boolean localPlayerNorthOf()
      True if the logged-in player's tile is strictly north of this object's tile (higher map Y, same plane). See PlayerRelativeToPoint.
    • localPlayerSouthOf

      public boolean localPlayerSouthOf()
      True if the local player is strictly south of this object (lower Y).
    • localPlayerWestOf

      public boolean localPlayerWestOf()
      True if the local player is strictly west of this object (lower X).
    • localPlayerEastOf

      public boolean localPlayerEastOf()
      True if the local player is strictly east of this object (higher X).
    • hasAction

      public boolean hasAction(String action)
      Whether the object definition exposes this action (e.g. Open, Mine).
    • hasActionLenientDefinitionScan

      public boolean hasActionLenientDefinitionScan(String action)
      Like hasAction(String) but, when the varbit-resolved composition has no matching action, also checks every distinct template id on the base definition (base id + ObjectComposition.getImpostorIds()). Some RSPS builds leave the resolved template's actions array empty while another impostor id still carries the real Open/Search strings the server honors.
    • getActions

      public String[] getActions()
      A copy of the transformed definition's raw action array (tags not stripped, null entries kept). Empty, never null, when unreadable. An array of nulls usually means the definition is not decoded yet, not that the object has no options.
    • exists

      public boolean exists()
      True if a scene object with the same id still exists at this tile (refreshed scan).

      Must read the scene on the game thread; re-enters safely when called from a script thread.

    • interact

      public boolean interact(String action)
      Resolves the menu entry by name (e.g. Open, Mine) and dispatches the matching object option.

      If the requested text is not found on the object definition, returns false — it does not fall back to option index 0 (that previously caused e.g. "Enter" when "Private" was missing from the match).

    • interact

      public boolean interact(String action, boolean walkOntoObject)
      Parameters:
      walkOntoObject - when true, the full packed object tag is passed so Impact's object-menu builder validates tileContainsUid(plane,x,y,tag) and AUTO-WALKS the player onto the object's launch tile. That walk is REQUIRED for grip/launch obstacles (zip-line "Teeth-grip" only fires from an exact tile), but BREAKS jump/climb/squeeze obstacles (stepping stone, hurdle, …): those fire directly from the current adjacent tile via the action packet alone, and prepending a walk-onto-object stops the jump. So callers escalate: dispatch direct (false) first, and only pass true if no progress results. 0 tag on the RuneLite EventBus path is harmless.
    • scenePoint

      public net.runelite.api.Point scenePoint()
      The scene tile an interaction with this object is dispatched against (menu param0/param1).