Record Class EntityDataAccessor<T>

java.lang.Object
java.lang.Record
net.minecraft.network.syncher.EntityDataAccessor<T>

public record EntityDataAccessor<T>(int id, EntityDataSerializer<T> serializer) extends Record
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The field for the id record component.
    private final EntityDataSerializer<T>
    The field for the serializer record component.
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Creates an instance of a EntityDataAccessor record class.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    boolean
    equals(Object p_135018_)
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    int
    id()
    Returns the value of the id record component.
    Returns the value of the serializer record component.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object Link icon

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details Link icon

    • id Link icon

      private final int id
      The field for the id record component.
    • serializer Link icon

      private final EntityDataSerializer<T> serializer
      The field for the serializer record component.
  • Constructor Details Link icon

    • EntityDataAccessor Link icon

      public EntityDataAccessor(int id, EntityDataSerializer<T> serializer)
      Creates an instance of a EntityDataAccessor record class.
      Parameters:
      id - the value for the id record component
      serializer - the value for the serializer record component
  • Method Details Link icon

    • equals Link icon

      public boolean equals(Object p_135018_)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      p_135018_ - the object with which to compare
      Returns:
      true if this object is the same as the p_135018_ argument; false otherwise.
    • hashCode Link icon

      public 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
    • toString Link icon

      public 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
    • id Link icon

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • serializer Link icon

      public EntityDataSerializer<T> serializer()
      Returns the value of the serializer record component.
      Returns:
      the value of the serializer record component