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> accessor, T value) 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(RegistryFriendlyByteBuf input, int id) private static <T> SynchedEntityData.DataValue<T> read(RegistryFriendlyByteBuf input, int id, EntityDataSerializer<T> serializer) Returns the value of theserializerrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.voidwrite(RegistryFriendlyByteBuf output)
-
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
-
write
-
read
-
read
private static <T> SynchedEntityData.DataValue<T> read(RegistryFriendlyByteBuf input, int id, EntityDataSerializer<T> serializer) -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-