Package com.valhalla.sdk.api.methods
Class GameObjects
java.lang.Object
com.valhalla.sdk.api.methods.GameObjects
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 Summary
Modifier and TypeMethodDescriptionstatic List<SceneObject> all()Returns all decoded scene objects.static List<SceneObject> all(Filter<SceneObject> filter) Selects all scene objects accepted by a filter.static List<SceneObject> Selects objects matching any non-null identifier.static List<SceneObject> Selects objects matching any exact name, ignoring case.static Optional<SceneObject> closest()Finds the nearest same-plane object.static Optional<SceneObject> closest(Filter<SceneObject> filter) Alias fornearest(Filter).static Optional<SceneObject> closest(Filter<SceneObject> filter, Tile toTile) Finds the filtered object nearest to an arbitrary tile.static Optional<SceneObject> Finds the nearest same-plane object matching any identifier.static Optional<SceneObject> Finds the nearest same-plane object matching any exact name, ignoring case.static intcount(Filter<SceneObject> filter) Counts objects accepted by a filter.static booleanexists(Filter<SceneObject> filter) Tests whether a filtered object exists.static booleanTests whether any candidate identifier exists.static booleanTests whether any candidate name exists.static List<SceneObject> getById(int id) Selects every object with an identifier.static List<SceneObject> Selects every object with an exact name, ignoring case.static SceneObject[]getObjectsOnTile(Tile tile) Returns every object whose captured world tile equals a tile.static Optional<SceneObject> getTopObjectOnTile(Tile tile) Returns the last native-enumerated object on a tile.static booleaninteract(int id, int x, int y, int plane, int action) Dispatches a raw action using explicit coordinates.static booleaninteract(int id, int x, int y, int plane, ObjectAction action) Dispatches a typed action using explicit coordinates.static booleanDispatches a raw action to an exact object identity and tile.static booleaninteract(int id, Tile tile, ObjectAction action) Dispatches a typed action to an exact object identity and tile.static booleaninteract(int id, ObjectAction action) Dispatches to the nearest same-plane object with an identifier.static booleaninteract(SceneObject object, ObjectAction action) Dispatches a typed action to an object snapshot.static booleaninteract(Filter<SceneObject> filter, ObjectAction action) Dispatches to the nearest same-plane object accepted by a filter.static booleaninteract(String name, ObjectAction action) Dispatches to the nearest same-plane object with an exact name.static Optional<SceneObject> nearest()Finds the nearest same-plane object.static Optional<SceneObject> nearest(Filter<SceneObject> filter) Finds the filtered same-plane object nearest to the local player.
-
Method Details
-
all
Returns all decoded scene objects.- Returns:
- all objects from the latest native scene snapshot
-
all
Selects all scene objects accepted by a filter.- Parameters:
filter- object predicate- Returns:
- matching objects in native enumeration order
-
all
Selects objects matching any non-null identifier.- Parameters:
ids- candidate object identifiers- Returns:
- matching objects, or an empty list for no candidates
-
all
Selects objects matching any exact name, ignoring case.- Parameters:
names- candidate names- Returns:
- matching objects, or an empty list for no candidates
-
getById
Selects every object with an identifier.- Parameters:
id- object definition identifier- Returns:
- matching snapshots
-
getByName
Selects every object with an exact name, ignoring case.- Parameters:
name- exact object name- Returns:
- matching snapshots, or an empty list for
null
-
nearest
Finds the nearest same-plane object.- Returns:
- nearest same-plane object by Chebyshev distance, or empty
-
closest
Finds the nearest same-plane object.- Returns:
- nearest same-plane object; alias for
nearest()
-
closest
Alias fornearest(Filter).- Parameters:
filter- object predicate- Returns:
- nearest matching same-plane object, or empty
-
closest
Finds the filtered object nearest to an arbitrary tile.- Parameters:
filter- object predicatetoTile- comparison tile and required plane- Returns:
- nearest matching object on the tile's plane, or empty
-
closest
Finds the nearest same-plane object matching any identifier.- Parameters:
ids- candidate identifiers- Returns:
- nearest match, or empty
-
closest
Finds the nearest same-plane object matching any exact name, ignoring case.- Parameters:
names- candidate names- Returns:
- nearest match, or empty
-
nearest
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
Dispatches a raw action to an exact object identity and tile.- Parameters:
id- object definition identifiertile- loaded scene tileaction- native object action opcode- Returns:
truewhen the client was ready and accepted dispatch
-
interact
Dispatches a typed action to an exact object identity and tile.- Parameters:
id- object definition identifiertile- loaded scene tileaction- ordered object menu action- Returns:
truewhen accepted; gameplay completion is not implied
-
interact
Dispatches a typed action to an object snapshot.- Parameters:
object- current object snapshotaction- ordered object menu action- Returns:
truewhen accepted
-
interact
Dispatches to the nearest same-plane object with an identifier.- Parameters:
id- object definition identifieraction- ordered object menu action- Returns:
truewhen a match existed and dispatch was accepted
-
interact
Dispatches to the nearest same-plane object with an exact name.- Parameters:
name- exact case-insensitive object nameaction- ordered object menu action- Returns:
truewhen a match existed and dispatch was accepted
-
interact
Dispatches to the nearest same-plane object accepted by a filter.- Parameters:
filter- object predicateaction- ordered object menu action- Returns:
truewhen a match existed and dispatch was accepted
-
getObjectsOnTile
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
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 identifierx- world Xy- world Yplane- world planeaction- native action opcode- Returns:
truewhen dispatch was accepted
-
interact
Dispatches a typed action using explicit coordinates.- Parameters:
id- object definition identifierx- world Xy- world Yplane- world planeaction- ordered object menu action- Returns:
truewhen dispatch was accepted
-
count
Counts objects accepted by a filter.- Parameters:
filter- object predicate- Returns:
- number of matching scene snapshots
-
exists
Tests whether a filtered object exists.- Parameters:
filter- object predicate- Returns:
- whether a same-plane matching object exists
-
exists
Tests whether any candidate identifier exists.- Parameters:
ids- candidate identifiers- Returns:
- whether a same-plane matching object exists
-
exists
Tests whether any candidate name exists.- Parameters:
names- candidate exact names- Returns:
- whether a same-plane matching object exists
-