Record Class Location
java.lang.Object
java.lang.Record
com.botwithus.bot.api.snapshot.Location
- Record Components:
typeId- ConfigType id, or-1if not resolvedinteractId- raw interact id (direct LOCATIONs only); always-1on sectionsanimationId- current animation id, or-1when not animating (always-1on sections)tileX- absolute world tile XtileY- absolute world tile Yplane-0..3shape- RT4 shape (0..22)rotation-0..3flags- bitset; inspect viaisHidden(),isCombinedSection(),isDeleted()resolvedId- v20+. The morph-resolved ("multiloc") loc id — the appearance definition carrying the name and the right-click options. A loc whose look and menu are chosen by a var (a Range, a bonfire, a bank chest, a construction hotspot, most instanced scenery) is published by the server as a base id whose definition has an empty name and no options, so a name or option lookup must use this id. EqualsbaseId()when the loc is not a multiloc — always usable, never a sentinel.
public record Location(int typeId, int interactId, int animationId, int tileX, int tileY, int plane, int shape, int rotation, int flags, int resolvedId)
extends Record
Snapshot of one scene Location (door / tree / rock / bank / scenery tile)
at the producer's current tick.
Rows come from two producer-side iteration paths — direct LOCATION
children and COMBINED_LOCATION_SECTION grandchildren. The two paths share
a field shape; isCombinedSection() distinguishes them so callers
filtering for parent vs child can split on it. Sections share their
parent COMBINED_LOCATION's lifetime, animation, and interact id — fields
that don't apply on sections read -1.
-
Constructor Summary
ConstructorsConstructorDescriptionLocation(int typeId, int interactId, int animationId, int tileX, int tileY, int plane, int shape, int rotation, int flags) Builds a row that is not a multiloc, derivingresolvedIdfrom the base id.Location(int typeId, int interactId, int animationId, int tileX, int tileY, int plane, int shape, int rotation, int flags, int resolvedId) Creates an instance of aLocationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theanimationIdrecord component.intbaseId()The id the server sent for this row — what identity, hardcoded id sets and interaction are keyed on.final booleanIndicates whether some other object is "equal to" this one.intflags()Returns the value of theflagsrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of theinteractIdrecord component.booleanbooleanbooleanisHidden()intplane()Returns the value of theplanerecord component.intReturns the value of theresolvedIdrecord component.introtation()Returns the value of therotationrecord component.intshape()Returns the value of theshaperecord component.inttileX()Returns the value of thetileXrecord component.inttileY()Returns the value of thetileYrecord component.final StringtoString()Returns a string representation of this record class.inttypeId()Returns the value of thetypeIdrecord component.
-
Constructor Details
-
Location
public Location(int typeId, int interactId, int animationId, int tileX, int tileY, int plane, int shape, int rotation, int flags) Builds a row that is not a multiloc, derivingresolvedIdfrom the base id. This is the wire's own default — the producer publishesresolvedId == baseIdfor every loc it does not transform — so it is the honest shape for a synthetic row. Use the canonical constructor to model a loc that really does morph. -
Location
public Location(int typeId, int interactId, int animationId, int tileX, int tileY, int plane, int shape, int rotation, int flags, int resolvedId) Creates an instance of aLocationrecord class.- Parameters:
typeId- the value for thetypeIdrecord componentinteractId- the value for theinteractIdrecord componentanimationId- the value for theanimationIdrecord componenttileX- the value for thetileXrecord componenttileY- the value for thetileYrecord componentplane- the value for theplanerecord componentshape- the value for theshaperecord componentrotation- the value for therotationrecord componentflags- the value for theflagsrecord componentresolvedId- the value for theresolvedIdrecord component
-
-
Method Details
-
baseId
public int baseId()The id the server sent for this row — what identity, hardcoded id sets and interaction are keyed on. A combined section carries it intypeId; a direct LOCATION carries it ininteractId. Use this for everything except a name or option lookup, which must useresolvedId(). -
isHidden
public boolean isHidden() -
isCombinedSection
public boolean isCombinedSection() -
isDeleted
public boolean isDeleted() -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
typeId
-
interactId
public int interactId()Returns the value of theinteractIdrecord component.- Returns:
- the value of the
interactIdrecord component
-
animationId
public int animationId()Returns the value of theanimationIdrecord component.- Returns:
- the value of the
animationIdrecord component
-
tileX
-
tileY
-
plane
-
shape
-
rotation
-
flags
-
resolvedId
public int resolvedId()Returns the value of theresolvedIdrecord component.- Returns:
- the value of the
resolvedIdrecord component
-