Package net.minecraft.network.syncher
Record Class EntityDataAccessor<T>
java.lang.Object
java.lang.Record
net.minecraft.network.syncher.EntityDataAccessor<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theidrecord component.private final EntityDataSerializer<T> The field for theserializerrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEntityDataAccessor(int id, EntityDataSerializer<T> serializer) Creates an instance of aEntityDataAccessorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.Returns the value of theserializerrecord component.toString()Returns a string representation of this record class.
-
Field Details
-
id
private final int idThe field for theidrecord component. -
serializer
The field for theserializerrecord component.
-
-
Constructor Details
-
EntityDataAccessor
Creates an instance of aEntityDataAccessorrecord class.- Parameters:
id- the value for theidrecord componentserializer- the value for theserializerrecord component
-
-
Method Details
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
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. -
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. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
serializer
Returns the value of theserializerrecord component.- Returns:
- the value of the
serializerrecord component
-