Record Class Location

java.lang.Object
java.lang.Record
com.botwithus.bot.api.snapshot.Location
Record Components:
typeId - ConfigType id, or -1 if not resolved
interactId - raw interact id (direct LOCATIONs only); always -1 on sections
animationId - current animation id, or -1 when not animating (always -1 on sections)
tileX - absolute world tile X
tileY - absolute world tile Y
plane - 0..3
shape - RT4 shape (0..22)
rotation - 0..3
flags - bitset; inspect via isHidden(), 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. Equals baseId() 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

    Constructors
    Constructor
    Description
    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, deriving resolvedId from 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 a Location record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the animationId record component.
    int
    The id the server sent for this row — what identity, hardcoded id sets and interaction are keyed on.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the flags record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the interactId record component.
    boolean
     
    boolean
     
    boolean
     
    int
    Returns the value of the plane record component.
    int
    Returns the value of the resolvedId record component.
    int
    Returns the value of the rotation record component.
    int
    Returns the value of the shape record component.
    int
    Returns the value of the tileX record component.
    int
    Returns the value of the tileY record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the typeId record component.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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, deriving resolvedId from the base id. This is the wire's own default — the producer publishes resolvedId == baseId for 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 a Location record class.
      Parameters:
      typeId - the value for the typeId record component
      interactId - the value for the interactId record component
      animationId - the value for the animationId record component
      tileX - the value for the tileX record component
      tileY - the value for the tileY record component
      plane - the value for the plane record component
      shape - the value for the shape record component
      rotation - the value for the rotation record component
      flags - the value for the flags record component
      resolvedId - the value for the resolvedId record 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 in typeId; a direct LOCATION carries it in interactId. Use this for everything except a name or option lookup, which must use resolvedId().
    • isHidden

      public boolean isHidden()
    • isCombinedSection

      public boolean isCombinedSection()
    • isDeleted

      public boolean isDeleted()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • typeId

      public int typeId()
      Returns the value of the typeId record component.
      Returns:
      the value of the typeId record component
    • interactId

      public int interactId()
      Returns the value of the interactId record component.
      Returns:
      the value of the interactId record component
    • animationId

      public int animationId()
      Returns the value of the animationId record component.
      Returns:
      the value of the animationId record component
    • tileX

      public int tileX()
      Returns the value of the tileX record component.
      Returns:
      the value of the tileX record component
    • tileY

      public int tileY()
      Returns the value of the tileY record component.
      Returns:
      the value of the tileY record component
    • plane

      public int plane()
      Returns the value of the plane record component.
      Returns:
      the value of the plane record component
    • shape

      public int shape()
      Returns the value of the shape record component.
      Returns:
      the value of the shape record component
    • rotation

      public int rotation()
      Returns the value of the rotation record component.
      Returns:
      the value of the rotation record component
    • flags

      public int flags()
      Returns the value of the flags record component.
      Returns:
      the value of the flags record component
    • resolvedId

      public int resolvedId()
      Returns the value of the resolvedId record component.
      Returns:
      the value of the resolvedId record component