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
Modifier and TypeFieldDescriptionstatic final int
private final int
The field for theid
record component.private final List
<SynchedEntityData.DataValue<?>> The field for thepackedItems
record component.static final StreamCodec
<RegistryFriendlyByteBuf, ClientboundSetEntityDataPacket> -
Constructor Summary
ModifierConstructorDescriptionClientboundSetEntityDataPacket
(int id, List<SynchedEntityData.DataValue<?>> packedItems) Creates an instance of aClientboundSetEntityDataPacket
record class.private
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientGamePacketListener p_133155_) final int
hashCode()
Returns a hash code value for this object.int
id()
Returns the value of theid
record component.private static void
pack
(List<SynchedEntityData.DataValue<?>> p_253940_, RegistryFriendlyByteBuf p_331850_) Returns the value of thepackedItems
record component.final String
toString()
Returns a string representation of this record class.type()
private static List
<SynchedEntityData.DataValue<?>> unpack
(RegistryFriendlyByteBuf p_330932_) private void
write
(RegistryFriendlyByteBuf p_333245_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
id
private final int idThe field for theid
record component. -
packedItems
The field for thepackedItems
record 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 aClientboundSetEntityDataPacket
record class.- Parameters:
id
- the value for theid
record componentpackedItems
- the value for thepackedItems
record component
-
-
Method Details
-
pack
private static void pack(List<SynchedEntityData.DataValue<?>> p_253940_, RegistryFriendlyByteBuf p_331850_) -
unpack
-
write
-
type
- Specified by:
type
in interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ClientGamePacketListener>
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
id
public int id()Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
packedItems
Returns the value of thepackedItems
record component.- Returns:
- the value of the
packedItems
record component
-