Record Class ServerboundUseItemOnPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundUseItemOnPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
public record ServerboundUseItemOnPacket(InteractionHand hand, BlockHitResult hitResult, int sequence)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InteractionHandThe field for thehandrecord component.private final BlockHitResultThe field for thehitResultrecord component.private final intThe field for thesequencerecord component.static final StreamCodec<FriendlyByteBuf, ServerboundUseItemOnPacket> -
Constructor Summary
ConstructorsConstructorDescriptionServerboundUseItemOnPacket(InteractionHand hand, BlockHitResult hitResult, int sequence) Creates an instance of aServerboundUseItemOnPacketrecord 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.Returns the value of thehitResultrecord component.intsequence()Returns the value of thesequencerecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
hand
The field for thehandrecord component. -
hitResult
The field for thehitResultrecord component. -
sequence
private final int sequenceThe field for thesequencerecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ServerboundUseItemOnPacket
Creates an instance of aServerboundUseItemOnPacketrecord class.- Parameters:
hand- the value for thehandrecord componenthitResult- the value for thehitResultrecord componentsequence- the value for thesequencerecord 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
-
hitResult
Returns the value of thehitResultrecord component.- Returns:
- the value of the
hitResultrecord component
-
sequence
public int sequence()Returns the value of thesequencerecord component.- Returns:
- the value of the
sequencerecord component
-