Record Class SyncPlayerDataPacketHandler
java.lang.Object
java.lang.Record
tech.anonymoushacker1279.immersiveweapons.event.SyncPlayerDataPacketHandler
- Record Components:
tag- theCompoundTagto sync, should be fromEntity.getPersistentData()playerUUID- theUUIDof the player to sync to
public record SyncPlayerDataPacketHandler(net.minecraft.nbt.CompoundTag tag, UUID playerUUID)
extends Record
A packet handler for syncing player persistent data from server to client.
-
Constructor Summary
ConstructorsConstructorDescriptionSyncPlayerDataPacketHandler(net.minecraft.nbt.CompoundTag tag, UUID playerUUID) Creates an instance of aSyncPlayerDataPacketHandlerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SyncPlayerDataPacketHandlerdecode(net.minecraft.network.FriendlyByteBuf packetBuffer) static voidencode(SyncPlayerDataPacketHandler msg, net.minecraft.network.FriendlyByteBuf packetBuffer) final booleanIndicates whether some other object is "equal to" this one.static voidhandle(SyncPlayerDataPacketHandler msg, Supplier<net.minecraftforge.network.NetworkEvent.Context> contextSupplier) final inthashCode()Returns a hash code value for this object.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.
-
Constructor Details
-
SyncPlayerDataPacketHandler
Creates an instance of aSyncPlayerDataPacketHandlerrecord class.- Parameters:
tag- the value for thetagrecord componentplayerUUID- the value for theplayerUUIDrecord component
-
-
Method Details
-
encode
public static void encode(SyncPlayerDataPacketHandler msg, net.minecraft.network.FriendlyByteBuf packetBuffer) -
decode
public static SyncPlayerDataPacketHandler decode(net.minecraft.network.FriendlyByteBuf packetBuffer) -
handle
public static void handle(SyncPlayerDataPacketHandler msg, Supplier<net.minecraftforge.network.NetworkEvent.Context> contextSupplier) -
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
-