Package net.minecraft.network.syncher
Record Class SynchedEntityData.DataValue<T>
java.lang.Object
java.lang.Record
net.minecraft.network.syncher.SynchedEntityData.DataValue<T>
- Enclosing class:
- SynchedEntityData
public static record SynchedEntityData.DataValue<T>(int id, EntityDataSerializer<T> serializer, T value)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theidrecord component.private final EntityDataSerializer<T>The field for theserializerrecord component.private final TThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDataValue(int id, EntityDataSerializer<T> serializer, T value) Creates an instance of aDataValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> SynchedEntityData.DataValue<T>create(EntityDataAccessor<T> p_254543_, T p_254138_) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.static SynchedEntityData.DataValue<?>read(FriendlyByteBuf p_254314_, int p_254356_) private static <T> SynchedEntityData.DataValue<T>read(FriendlyByteBuf p_254224_, int p_253899_, EntityDataSerializer<T> p_254222_) Returns the value of theserializerrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.voidwrite(FriendlyByteBuf p_253709_)
-
Field Details
-
id
private final int idThe field for theidrecord component. -
serializer
The field for theserializerrecord component. -
value
The field for thevaluerecord component.
-
-
Constructor Details
-
DataValue
Creates an instance of aDataValuerecord class.- Parameters:
id- the value for theidrecord componentserializer- the value for theserializerrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
create
public static <T> SynchedEntityData.DataValue<T> create(EntityDataAccessor<T> p_254543_, T p_254138_) -
write
-
read
-
read
private static <T> SynchedEntityData.DataValue<T> read(FriendlyByteBuf p_254224_, int p_253899_, EntityDataSerializer<T> p_254222_) -
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. -
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. -
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 '=='. -
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
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-