Class GameObjects

java.lang.Object
com.valhalla.sdk.api.methods.GameObjects

public final class GameObjects extends Object
Queries immutable scene-object snapshots and dispatches native object actions.

Nearest-object queries use same-plane Chebyshev distance; they do not prove collision reachability. An interaction returning true confirms native dispatch only. Re-query objects, the player, or another expected state before considering an obstacle complete.

  • Method Details

    • all

      public static List<SceneObject> all()
      Returns all decoded scene objects.
      Returns:
      all objects from the latest native scene snapshot
    • all

      public static List<SceneObject> all(Filter<SceneObject> filter)
      Selects all scene objects accepted by a filter.
      Parameters:
      filter - object predicate
      Returns:
      matching objects in native enumeration order
    • all

      public static List<SceneObject> all(Integer... ids)
      Selects objects matching any non-null identifier.
      Parameters:
      ids - candidate object identifiers
      Returns:
      matching objects, or an empty list for no candidates
    • all

      public static List<SceneObject> all(String... names)
      Selects objects matching any exact name, ignoring case.
      Parameters:
      names - candidate names
      Returns:
      matching objects, or an empty list for no candidates
    • getById

      public static List<SceneObject> getById(int id)
      Selects every object with an identifier.
      Parameters:
      id - object definition identifier
      Returns:
      matching snapshots
    • getByName

      public static List<SceneObject> getByName(String name)
      Selects every object with an exact name, ignoring case.
      Parameters:
      name - exact object name
      Returns:
      matching snapshots, or an empty list for null
    • nearest

      public static Optional<SceneObject> nearest()
      Finds the nearest same-plane object.
      Returns:
      nearest same-plane object by Chebyshev distance, or empty
    • closest

      public static Optional<SceneObject> closest()
      Finds the nearest same-plane object.
      Returns:
      nearest same-plane object; alias for nearest()
    • closest

      public static Optional<SceneObject> closest(Filter<SceneObject> filter)
      Alias for nearest(Filter).
      Parameters:
      filter - object predicate
      Returns:
      nearest matching same-plane object, or empty
    • closest

      public static Optional<SceneObject> closest(Filter<SceneObject> filter, Tile toTile)
      Finds the filtered object nearest to an arbitrary tile.
      Parameters:
      filter - object predicate
      toTile - comparison tile and required plane
      Returns:
      nearest matching object on the tile's plane, or empty
    • closest

      public static Optional<SceneObject> closest(Integer... ids)
      Finds the nearest same-plane object matching any identifier.
      Parameters:
      ids - candidate identifiers
      Returns:
      nearest match, or empty
    • closest

      public static Optional<SceneObject> closest(String... names)
      Finds the nearest same-plane object matching any exact name, ignoring case.
      Parameters:
      names - candidate names
      Returns:
      nearest match, or empty
    • nearest

      public static Optional<SceneObject> nearest(Filter<SceneObject> filter)
      Finds the filtered same-plane object nearest to the local player.
      Parameters:
      filter - object predicate
      Returns:
      nearest matching snapshot by Chebyshev distance, or empty
    • interact

      public static boolean interact(int id, Tile tile, int action)
      Dispatches a raw action to an exact object identity and tile.
      Parameters:
      id - object definition identifier
      tile - loaded scene tile
      action - native object action opcode
      Returns:
      true when the client was ready and accepted dispatch
    • interact

      public static boolean interact(int id, Tile tile, ObjectAction action)
      Dispatches a typed action to an exact object identity and tile.
      Parameters:
      id - object definition identifier
      tile - loaded scene tile
      action - ordered object menu action
      Returns:
      true when accepted; gameplay completion is not implied
    • interact

      public static boolean interact(SceneObject object, ObjectAction action)
      Dispatches a typed action to an object snapshot.
      Parameters:
      object - current object snapshot
      action - ordered object menu action
      Returns:
      true when accepted
    • interact

      public static boolean interact(int id, ObjectAction action)
      Dispatches to the nearest same-plane object with an identifier.
      Parameters:
      id - object definition identifier
      action - ordered object menu action
      Returns:
      true when a match existed and dispatch was accepted
    • interact

      public static boolean interact(String name, ObjectAction action)
      Dispatches to the nearest same-plane object with an exact name.
      Parameters:
      name - exact case-insensitive object name
      action - ordered object menu action
      Returns:
      true when a match existed and dispatch was accepted
    • interact

      public static boolean interact(Filter<SceneObject> filter, ObjectAction action)
      Dispatches to the nearest same-plane object accepted by a filter.
      Parameters:
      filter - object predicate
      action - ordered object menu action
      Returns:
      true when a match existed and dispatch was accepted
    • getObjectsOnTile

      public static SceneObject[] getObjectsOnTile(Tile tile)
      Returns every object whose captured world tile equals a tile.
      Parameters:
      tile - exact world tile
      Returns:
      newly allocated object array in native enumeration order
    • getTopObjectOnTile

      public static Optional<SceneObject> getTopObjectOnTile(Tile tile)
      Returns the last native-enumerated object on a tile.
      Parameters:
      tile - exact world tile
      Returns:
      final enumerated object, or empty
    • interact

      public static boolean interact(int id, int x, int y, int plane, int action)
      Dispatches a raw action using explicit coordinates.
      Parameters:
      id - object definition identifier
      x - world X
      y - world Y
      plane - world plane
      action - native action opcode
      Returns:
      true when dispatch was accepted
    • interact

      public static boolean interact(int id, int x, int y, int plane, ObjectAction action)
      Dispatches a typed action using explicit coordinates.
      Parameters:
      id - object definition identifier
      x - world X
      y - world Y
      plane - world plane
      action - ordered object menu action
      Returns:
      true when dispatch was accepted
    • count

      public static int count(Filter<SceneObject> filter)
      Counts objects accepted by a filter.
      Parameters:
      filter - object predicate
      Returns:
      number of matching scene snapshots
    • exists

      public static boolean exists(Filter<SceneObject> filter)
      Tests whether a filtered object exists.
      Parameters:
      filter - object predicate
      Returns:
      whether a same-plane matching object exists
    • exists

      public static boolean exists(Integer... ids)
      Tests whether any candidate identifier exists.
      Parameters:
      ids - candidate identifiers
      Returns:
      whether a same-plane matching object exists
    • exists

      public static boolean exists(String... names)
      Tests whether any candidate name exists.
      Parameters:
      names - candidate exact names
      Returns:
      whether a same-plane matching object exists