Record Class ClientboundSwingAnimationPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundSwingAnimationPacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundSwingAnimationPacket(int entityId, InteractionHand hand, SwingAnimation animation)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SwingAnimationThe field for theanimationrecord component.private final intThe field for theentityIdrecord component.private final InteractionHandThe field for thehandrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, ClientboundSwingAnimationPacket> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundSwingAnimationPacket(int entityId, InteractionHand hand, SwingAnimation animation) Creates an instance of aClientboundSwingAnimationPacketrecord class.ClientboundSwingAnimationPacket(Entity entity, InteractionHand hand, SwingAnimation animation) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theanimationrecord component.intentityId()Returns the value of theentityIdrecord component.final booleanIndicates whether some other object is "equal to" this one.hand()Returns the value of thehandrecord component.voidhandle(ClientGamePacketListener listener) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
entityId
private final int entityIdThe field for theentityIdrecord component. -
hand
The field for thehandrecord component. -
animation
The field for theanimationrecord component. -
STREAM_CODEC
public static final StreamCodec<io.netty.buffer.ByteBuf, ClientboundSwingAnimationPacket> STREAM_CODEC
-
-
Constructor Details
-
ClientboundSwingAnimationPacket
public ClientboundSwingAnimationPacket(Entity entity, InteractionHand hand, SwingAnimation animation) -
ClientboundSwingAnimationPacket
public ClientboundSwingAnimationPacket(int entityId, InteractionHand hand, SwingAnimation animation) Creates an instance of aClientboundSwingAnimationPacketrecord class.- Parameters:
entityId- the value for theentityIdrecord componenthand- the value for thehandrecord componentanimation- the value for theanimationrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
- 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. -
entityId
public int entityId()Returns the value of theentityIdrecord component.- Returns:
- the value of the
entityIdrecord component
-
hand
Returns the value of thehandrecord component.- Returns:
- the value of the
handrecord component
-
animation
Returns the value of theanimationrecord component.- Returns:
- the value of the
animationrecord component
-