Record Class ServerboundUseItemPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundUseItemPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
public record ServerboundUseItemPacket(InteractionHand hand, int sequence, float yRot, float xRot)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InteractionHandThe field for thehandrecord component.private final intThe field for thesequencerecord component.static final StreamCodec<FriendlyByteBuf, ServerboundUseItemPacket> private final floatThe field for thexRotrecord component.private final floatThe field for theyRotrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionServerboundUseItemPacket(InteractionHand hand, int sequence, float yRot, float xRot) Creates an instance of aServerboundUseItemPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.hand()Returns the value of thehandrecord component.voidhandle(ServerGamePacketListener listener) final inthashCode()Returns a hash code value for this object.intsequence()Returns the value of thesequencerecord component.final StringtoString()Returns a string representation of this record class.type()floatxRot()Returns the value of thexRotrecord component.floatyRot()Returns the value of theyRotrecord component.Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
hand
The field for thehandrecord component. -
sequence
private final int sequenceThe field for thesequencerecord component. -
yRot
private final float yRotThe field for theyRotrecord component. -
xRot
private final float xRotThe field for thexRotrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ServerboundUseItemPacket
Creates an instance of aServerboundUseItemPacketrecord class.- Parameters:
hand- the value for thehandrecord componentsequence- the value for thesequencerecord componentyRot- the value for theyRotrecord componentxRot- the value for thexRotrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ServerGamePacketListener>
-
handle
- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
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. -
hand
Returns the value of thehandrecord component.- Returns:
- the value of the
handrecord component
-
sequence
public int sequence()Returns the value of thesequencerecord component.- Returns:
- the value of the
sequencerecord component
-
yRot
public float yRot()Returns the value of theyRotrecord component.- Returns:
- the value of the
yRotrecord component
-
xRot
public float xRot()Returns the value of thexRotrecord component.- Returns:
- the value of the
xRotrecord component
-