Package com.valhalla.sdk.api.methods
Class GroundItems
java.lang.Object
com.valhalla.sdk.api.methods.GroundItems
Queries ground-item snapshots and dispatches native ground-item actions.
Nearest queries are same-plane distance searches. Prefer nearestReachable()
when movement matters, while remembering that reachability falls back to loaded-tile
validation if collision data is absent. A successful interaction confirms action
acceptance only; verify inventory or ground-item state afterward.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<GroundItem> all()Returns all decoded ground-item stacks.static List<GroundItem> all(Filter<GroundItem> filter) Selects all ground items accepted by a filter.static List<GroundItem> Selects ground items matching any non-null identifier.static List<GroundItem> Selects ground items matching any exact name, ignoring case.static Optional<GroundItem> closest()Finds the nearest same-plane ground item.static Optional<GroundItem> closest(Filter<GroundItem> filter) Alias fornearest(Filter).static Optional<GroundItem> closest(Filter<GroundItem> filter, Tile toTile) Finds the filtered stack nearest to an arbitrary tile.static Optional<GroundItem> Finds the nearest same-plane stack matching any identifier.static Optional<GroundItem> Finds the nearest same-plane stack matching any exact name, ignoring case.static intcount(Filter<GroundItem> filter) Counts ground items accepted by a filter.static booleanexists(Filter<GroundItem> filter) Tests whether a filtered ground item exists.static booleanTests whether any candidate identifier exists.static booleanTests whether any candidate name exists.static List<GroundItem> getById(int id) Selects every ground-item stack with an identifier.static List<GroundItem> Selects every stack with an exact name, ignoring case.static List<GroundItem> getForTile(Tile tile) Returns every ground-item stack on an exact world 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, GroundItemAction action) Dispatches a typed action using explicit coordinates.static booleanDispatches a raw action to an exact ground-item identity and tile.static booleaninteract(int id, Tile tile, GroundItemAction action) Dispatches a typed action to an exact ground-item identity and tile.static booleaninteract(int id, GroundItemAction action) Dispatches to the nearest same-plane stack with an identifier.static booleaninteract(GroundItem item, GroundItemAction action) Dispatches a typed action to a current ground-item snapshot.static booleaninteract(Filter<GroundItem> filter, GroundItemAction action) Dispatches to the nearest same-plane stack accepted by a filter.static booleaninteract(String name, GroundItemAction action) Dispatches to the nearest same-plane stack with an exact name.static Optional<GroundItem> nearest()Finds the nearest same-plane ground item.static Optional<GroundItem> nearest(Filter<GroundItem> filter) Finds the filtered same-plane stack nearest to the local player.static Optional<GroundItem> Finds the nearest reachable ground item.static Optional<GroundItem> nearestReachable(Filter<GroundItem> filter) Finds the nearest reachable item accepted by a filter.static Optional<GroundItem> nearestReachable(Filter<GroundItem> filter, int maximumDistance) Finds the nearest reachable filtered item within a distance limit.static List<GroundItem> Returns same-plane items accepted by local collision reachability.static List<GroundItem> reachable(int maximumDistance) Returns same-plane reachable items within a direct-distance limit.static List<GroundItem> reachable(Filter<GroundItem> filter) Returns filtered same-plane items accepted by local collision reachability.static List<GroundItem> reachable(Filter<GroundItem> filter, int maximumDistance) Returns filtered same-plane reachable items within a distance limit.
-
Method Details
-
all
Returns all decoded ground-item stacks.- Returns:
- all ground-item stacks from the latest native scene snapshot
-
all
Selects all ground items accepted by a filter.- Parameters:
filter- item predicate- Returns:
- matching snapshots in native enumeration order
-
all
Selects ground items matching any non-null identifier.- Parameters:
ids- candidate item identifiers- Returns:
- matching snapshots, or an empty list for no candidates
-
all
Selects ground items matching any exact name, ignoring case.- Parameters:
names- candidate names- Returns:
- matching snapshots, or an empty list for no candidates
-
getById
Selects every ground-item stack with an identifier.- Parameters:
id- item definition identifier- Returns:
- matching snapshots
-
getByName
Selects every stack with an exact name, ignoring case.- Parameters:
name- exact item name- Returns:
- matching snapshots, or an empty list for
null
-
nearest
Finds the nearest same-plane ground item.- Returns:
- nearest same-plane ground item by Chebyshev distance, or empty
-
closest
Finds the nearest same-plane ground item.- Returns:
- nearest same-plane ground item; alias for
nearest()
-
closest
Alias fornearest(Filter).- Parameters:
filter- item predicate- Returns:
- nearest matching same-plane stack, or empty
-
closest
Finds the filtered stack nearest to an arbitrary tile.- Parameters:
filter- item predicatetoTile- comparison tile and required plane- Returns:
- nearest matching stack on the tile's plane, or empty
-
closest
Finds the nearest same-plane stack matching any identifier.- Parameters:
ids- candidate identifiers- Returns:
- nearest match, or empty
-
closest
Finds the nearest same-plane stack matching any exact name, ignoring case.- Parameters:
names- candidate names- Returns:
- nearest match, or empty
-
nearest
Finds the filtered same-plane stack nearest to the local player.- Parameters:
filter- item predicate- Returns:
- nearest matching stack by Chebyshev distance, or empty
-
reachable
Returns same-plane items accepted by local collision reachability.- Returns:
- reachable items; loaded same-plane items are used as a fallback without collision
-
reachable
Returns filtered same-plane items accepted by local collision reachability.- Parameters:
filter- item predicate- Returns:
- reachable matching items
-
reachable
Returns same-plane reachable items within a direct-distance limit.- Parameters:
maximumDistance- inclusive Chebyshev distance- Returns:
- reachable items within the limit
-
reachable
Returns filtered same-plane reachable items within a distance limit.If live collision is unavailable, a loaded same-plane tile is treated as a permissive fallback and may still be separated by an obstacle.
- Parameters:
filter- item predicatemaximumDistance- inclusive non-negative Chebyshev distance- Returns:
- matching reachable snapshots
-
nearestReachable
Finds the nearest reachable ground item.- Returns:
- nearest reachable ground item, or empty
-
nearestReachable
Finds the nearest reachable item accepted by a filter.- Parameters:
filter- item predicate- Returns:
- nearest reachable match, or empty
-
nearestReachable
Finds the nearest reachable filtered item within a distance limit.- Parameters:
filter- item predicatemaximumDistance- inclusive Chebyshev distance- Returns:
- nearest reachable match, or empty
-
interact
Dispatches a raw action to an exact ground-item identity and tile.- Parameters:
id- item definition identifiertile- loaded scene tileaction- native ground-item action opcode- Returns:
truewhen the client was ready and accepted dispatch
-
interact
Dispatches a typed action to an exact ground-item identity and tile.- Parameters:
id- item definition identifiertile- loaded scene tileaction- ground-item menu action- Returns:
truewhen accepted; item collection is not implied
-
interact
Dispatches a typed action to a current ground-item snapshot.- Parameters:
item- current stack snapshotaction- ground-item menu action- Returns:
truewhen accepted
-
interact
Dispatches to the nearest same-plane stack with an identifier.- Parameters:
id- item definition identifieraction- ground-item menu action- Returns:
truewhen a match existed and dispatch was accepted
-
interact
Dispatches to the nearest same-plane stack with an exact name.- Parameters:
name- exact case-insensitive item nameaction- ground-item menu action- Returns:
truewhen a match existed and dispatch was accepted
-
interact
Dispatches to the nearest same-plane stack accepted by a filter.- Parameters:
filter- item predicateaction- ground-item menu action- Returns:
truewhen a match existed and dispatch was accepted
-
getForTile
Returns every ground-item stack on an exact world tile.- Parameters:
tile- exact world tile- Returns:
- matching snapshots
-
interact
public static boolean interact(int id, int x, int y, int plane, int action) Dispatches a raw action using explicit coordinates.- Parameters:
id- item 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- item definition identifierx- world Xy- world Yplane- world planeaction- ground-item menu action- Returns:
truewhen dispatch was accepted
-
count
Counts ground items accepted by a filter.- Parameters:
filter- item predicate- Returns:
- number of matching ground-item stacks
-
exists
Tests whether a filtered ground item exists.- Parameters:
filter- item predicate- Returns:
- whether a same-plane matching stack exists
-
exists
Tests whether any candidate identifier exists.- Parameters:
ids- candidate identifiers- Returns:
- whether a same-plane matching stack exists
-
exists
Tests whether any candidate name exists.- Parameters:
names- candidate exact names- Returns:
- whether a same-plane matching stack exists
-