Record Class TrackerData

java.lang.Object
java.lang.Record
kr.toxicity.model.api.tracker.TrackerData
Record Components:
id - the model ID
scaler - the model scaler
rotator - the model rotator
modifier - the tracker modifier
bodyRotator - the body rotation data
hideOption - the entity hide options
markForSpawn - the set of player UUIDs marked for spawning

public record TrackerData(@NotNull String id, @Nullable ModelScaler scaler, @Nullable ModelRotator rotator, @NotNull TrackerModifier modifier, EntityBodyRotator.RotatorData bodyRotator, @Nullable EntityHideOption hideOption, @Nullable Set<UUID> markForSpawn) extends Record
Represents the persistent data state of a tracker.

This record holds configuration and state information such as model ID, scaling, rotation, and visibility options, which can be serialized to JSON.

Since:
1.15.2
  • Field Details

    • PARSER

      public static final com.google.gson.Gson PARSER
      The GSON parser for serializing and deserializing tracker data.
      Since:
      1.15.2
  • Constructor Details

    • TrackerData

      public TrackerData(@NotNull @NotNull String id, @Nullable @Nullable ModelScaler scaler, @Nullable @Nullable ModelRotator rotator, @NotNull @NotNull TrackerModifier modifier, @Nullable EntityBodyRotator.RotatorData bodyRotator, @Nullable @Nullable EntityHideOption hideOption, @Nullable @Nullable Set<UUID> markForSpawn)
      Creates an instance of a TrackerData record class.
      Parameters:
      id - the value for the id record component
      scaler - the value for the scaler record component
      rotator - the value for the rotator record component
      modifier - the value for the modifier record component
      bodyRotator - the value for the bodyRotator record component
      hideOption - the value for the hideOption record component
      markForSpawn - the value for the markForSpawn record component
  • Method Details

    • applyAs

      public void applyAs(@NotNull @NotNull EntityTracker tracker)
      Applies this data to an existing entity tracker.
      Parameters:
      tracker - the target tracker
      Since:
      1.15.2
    • serialize

      @NotNull public @NotNull com.google.gson.JsonElement serialize()
      Serializes this data to a JSON element.
      Returns:
      the JSON element
      Since:
      1.15.2
    • deserialize

      @NotNull public static @NotNull TrackerData deserialize(@NotNull @NotNull com.google.gson.JsonElement element)
      Deserializes tracker data from a JSON element.
      Parameters:
      element - the JSON element
      Returns:
      the tracker data
      Since:
      1.15.2
    • scaler

      @NotNull public @NotNull ModelScaler scaler()
      Returns the value of the scaler record component.
      Returns:
      the value of the scaler record component
    • rotator

      @NotNull public @NotNull ModelRotator rotator()
      Returns the value of the rotator record component.
      Returns:
      the value of the rotator record component
    • hideOption

      @NotNull public @NotNull EntityHideOption hideOption()
      Returns the value of the hideOption record component.
      Returns:
      the value of the hideOption record component
    • markForSpawn

      @NotNull public @NotNull Set<UUID> markForSpawn()
      Returns the value of the markForSpawn record component.
      Returns:
      the value of the markForSpawn record component
    • bodyRotator

      @NotNull public EntityBodyRotator.RotatorData bodyRotator()
      Returns the value of the bodyRotator record component.
      Returns:
      the value of the bodyRotator record component
    • toString

      @NotNull public @NotNull 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 Objects::equals(Object,Object).
      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.
    • id

      @NotNull public @NotNull String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • modifier

      @NotNull public @NotNull TrackerModifier modifier()
      Returns the value of the modifier record component.
      Returns:
      the value of the modifier record component