Record Class ClientboundSetEntityDataPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundSetEntityDataPacket(int id, List<SynchedEntityData.DataValue<?>> packedItems)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate final intThe field for theidrecord component.private final List<SynchedEntityData.DataValue<?>> The field for thepackedItemsrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundSetEntityDataPacket> -
Constructor Summary
ConstructorsModifierConstructorDescriptionClientboundSetEntityDataPacket(int id, List<SynchedEntityData.DataValue<?>> packedItems) Creates an instance of aClientboundSetEntityDataPacketrecord class.private -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidhandle(ClientGamePacketListener listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.private static voidpack(List<SynchedEntityData.DataValue<?>> items, RegistryFriendlyByteBuf output) Returns the value of thepackedItemsrecord component.final StringtoString()Returns a string representation of this record class.type()private static List<SynchedEntityData.DataValue<?>> unpack(RegistryFriendlyByteBuf input) private voidwrite(RegistryFriendlyByteBuf output) Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
id
private final int idThe field for theidrecord component. -
packedItems
The field for thepackedItemsrecord component. -
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundSetEntityDataPacket> STREAM_CODEC -
EOF_MARKER
public static final int EOF_MARKER- See Also:
-
-
Constructor Details
-
ClientboundSetEntityDataPacket
-
ClientboundSetEntityDataPacket
Creates an instance of aClientboundSetEntityDataPacketrecord class.- Parameters:
id- the value for theidrecord componentpackedItems- the value for thepackedItemsrecord component
-
-
Method Details
-
pack
private static void pack(List<SynchedEntityData.DataValue<?>> items, RegistryFriendlyByteBuf output) -
unpack
-
write
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ClientGamePacketListener>
-
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
-
packedItems
Returns the value of thepackedItemsrecord component.- Returns:
- the value of the
packedItemsrecord component
-