Package net.minecraft.network.syncher
Record Class EntityDataAccessor<T>
java.lang.Object
java.lang.Record
net.minecraft.network.syncher.EntityDataAccessor<T>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
The field for theid
record component.private final EntityDataSerializer
<T> The field for theserializer
record component. -
Constructor Summary
ConstructorDescriptionEntityDataAccessor
(int id, EntityDataSerializer<T> serializer) Creates an instance of aEntityDataAccessor
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.int
id()
Returns the value of theid
record component.Returns the value of theserializer
record component.toString()
Returns a string representation of this record class.
-
Field Details
-
id
private final int idThe field for theid
record component. -
serializer
The field for theserializer
record component.
-
-
Constructor Details
-
EntityDataAccessor
Creates an instance of aEntityDataAccessor
record class.- Parameters:
id
- the value for theid
record componentserializer
- the value for theserializer
record 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 theid
record component.- Returns:
- the value of the
id
record component
-
serializer
Returns the value of theserializer
record component.- Returns:
- the value of the
serializer
record component
-