Record Class SpotAnimEvent

java.lang.Object
java.lang.Record
com.botwithus.bot.api.event.SpotAnimEvent
Record Components:
targetServerIndex - entity server slot, or -1 for world/static
targetType - 0 = player, 1 = npc, 2 = world
spotAnimId - the spot anim (graphic) id
tileX - tile X (entity's, or the world graphic's) when it started
tileY - tile Y (entity's, or the world graphic's) when it started
plane - plane (0..3)
timestamp - event creation time in milliseconds since epoch
All Implemented Interfaces:
GameEvent

public record SpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane, long timestamp) extends Record implements GameEvent
Fired when a new spot animation (graphic) starts playing. The producer emits one event per newly-started spot anim (edge-triggered — it does not re-fire while a spot anim persists across ticks). Two flavours share this event:
  • Entity-attached (targetType 0 = player / 1 = npc): the graphic plays on an NPC/player, walked from that entity's graph-node children. targetServerIndex is the entity's server slot; tileX/tileY/plane are its tile when the spot anim started. An entity can play several at once; the per-entity snapshot field surfaces only the first, so this event is the way to observe every one.
  • World/static (targetType == 2, targetServerIndex == -1): the graphic plays on a tile with no entity (spell splashes, AoE effects, ground sparkles), walked from the world SpotAnimList. tileX/tileY are the graphic's world tile; plane is the local player's plane (the active render level). Use isWorldAnchored() to distinguish these.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane)
     
    SpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane, long timestamp)
    Creates an instance of a SpotAnimEvent record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    True for a world/static spot anim — one playing on a tile with no entity (targetServerIndex == -1, equivalently targetType == 2).
    int
    Returns the value of the plane record component.
    int
    Returns the value of the spotAnimId record component.
    int
    Returns the value of the targetServerIndex record component.
    int
    Returns the value of the targetType record component.
    int
    Returns the value of the tileX record component.
    int
    Returns the value of the tileY record component.
    long
    Returns the value of the timestamp record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface GameEvent

    type
  • Constructor Details

    • SpotAnimEvent

      public SpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane)
    • SpotAnimEvent

      public SpotAnimEvent(int targetServerIndex, int targetType, int spotAnimId, int tileX, int tileY, int plane, long timestamp)
      Creates an instance of a SpotAnimEvent record class.
      Parameters:
      targetServerIndex - the value for the targetServerIndex record component
      targetType - the value for the targetType record component
      spotAnimId - the value for the spotAnimId 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
      timestamp - the value for the timestamp record component
  • Method Details

    • isWorldAnchored

      public boolean isWorldAnchored()
      True for a world/static spot anim — one playing on a tile with no entity (targetServerIndex == -1, equivalently targetType == 2). For these, tileX/tileY carry the graphic's world tile.
    • 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.
    • targetServerIndex

      public int targetServerIndex()
      Returns the value of the targetServerIndex record component.
      Returns:
      the value of the targetServerIndex record component
    • targetType

      public int targetType()
      Returns the value of the targetType record component.
      Returns:
      the value of the targetType record component
    • spotAnimId

      public int spotAnimId()
      Returns the value of the spotAnimId record component.
      Returns:
      the value of the spotAnimId 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
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Specified by:
      timestamp in interface GameEvent
      Returns:
      the value of the timestamp record component