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

    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

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

    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

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

    • id

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

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

    • EntityDataAccessor

      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

    • equals

      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

      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

      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

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

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