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 SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionDataValue(int id, EntityDataSerializer<T> serializer, T value) Creates an instance of aDataValuerecord class.
- 
Method SummaryModifier 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- 
idprivate final int idThe field for theidrecord component.
- 
serializerThe field for theserializerrecord component.
- 
valueThe field for thevaluerecord component.
 
- 
- 
Constructor Details- 
DataValueCreates an instance of aDataValuerecord class.- Parameters:
- id- the value for the- idrecord component
- serializer- the value for the- serializerrecord component
- value- the value for the- valuerecord component
 
 
- 
- 
Method Details- 
createpublic static <T> SynchedEntityData.DataValue<T> create(EntityDataAccessor<T> p_254543_, T p_254138_) 
- 
write
- 
read
- 
readprivate static <T> SynchedEntityData.DataValue<T> read(FriendlyByteBuf p_254224_, int p_253899_, EntityDataSerializer<T> p_254222_) 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
idpublic int id()Returns the value of theidrecord component.- Returns:
- the value of the idrecord component
 
- 
serializerReturns the value of theserializerrecord component.- Returns:
- the value of the serializerrecord component
 
- 
valueReturns the value of thevaluerecord component.- Returns:
- the value of the valuerecord component
 
 
-