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 p_133155_) final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.private static voidpack(List<SynchedEntityData.DataValue<?>> p_253940_, RegistryFriendlyByteBuf p_320247_) Returns the value of thepackedItemsrecord component.final StringtoString()Returns a string representation of this record class.type()private static List<SynchedEntityData.DataValue<?>> unpack(RegistryFriendlyByteBuf p_320523_) private voidwrite(RegistryFriendlyByteBuf p_320560_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.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<?>> p_253940_, RegistryFriendlyByteBuf p_320247_) -
unpack
-
write
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handlein 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 theidrecord component.- Returns:
- the value of the
idrecord component
-
packedItems
Returns the value of thepackedItemsrecord component.- Returns:
- the value of the
packedItemsrecord component
-