Record Class SyncPlayerDataPayload
java.lang.Object
java.lang.Record
tech.anonymoushacker1279.immersiveweapons.network.payload.SyncPlayerDataPayload
- Record Components:
tag- theCompoundTagto sync, should be fromEntity.getPersistentData()playerUUID- theUUIDof the player to sync to
- All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
public record SyncPlayerDataPayload(net.minecraft.nbt.CompoundTag tag, UUID playerUUID)
extends Record
implements net.minecraft.network.protocol.common.custom.CustomPacketPayload
A packet payload for syncing player persistent data between the server and client.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSyncPlayerDataPayload(net.minecraft.nbt.CompoundTag tag, UUID playerUUID) Creates an instance of aSyncPlayerDataPayloadrecord class.SyncPlayerDataPayload(net.minecraft.network.FriendlyByteBuf buffer) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()Returns the value of theplayerUUIDrecord component.net.minecraft.nbt.CompoundTagtag()Returns the value of thetagrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(net.minecraft.network.FriendlyByteBuf buffer)
-
Field Details
-
ID
public static final net.minecraft.resources.ResourceLocation ID
-
-
Constructor Details
-
SyncPlayerDataPayload
public SyncPlayerDataPayload(net.minecraft.network.FriendlyByteBuf buffer) -
SyncPlayerDataPayload
Creates an instance of aSyncPlayerDataPayloadrecord class.- Parameters:
tag- the value for thetagrecord componentplayerUUID- the value for theplayerUUIDrecord component
-
-
Method Details
-
write
public void write(net.minecraft.network.FriendlyByteBuf buffer) - Specified by:
writein interfacenet.minecraft.network.protocol.common.custom.CustomPacketPayload
-
id
public net.minecraft.resources.ResourceLocation id()- Specified by:
idin interfacenet.minecraft.network.protocol.common.custom.CustomPacketPayload
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
tag
public net.minecraft.nbt.CompoundTag tag()Returns the value of thetagrecord component.- Returns:
- the value of the
tagrecord component
-
playerUUID
Returns the value of theplayerUUIDrecord component.- Returns:
- the value of the
playerUUIDrecord component
-