Class S2CGrabResultPacket
java.lang.Object
net.timtaran.interactivemc.network.sync.packet.HandInteractionPacket
net.timtaran.interactivemc.network.sync.packet.S2CGrabResultPacket
- All Implemented Interfaces:
net.xmx.velthoric.network.IVxNetPacket
Server-to-Client packet containing the result of a grab action.
This packet is sent from the server in response to a C2SGrabPacket,
containing the UUID of the successfully grabbed body or null if the grab failed.
-
Constructor Summary
ConstructorsConstructorDescriptionS2CGrabResultPacket(net.minecraft.world.InteractionHand interactionHand, UUID grabbedBodyUUID) Constructs a new grab result packet. -
Method Summary
Modifier and TypeMethodDescriptionstatic S2CGrabResultPacketdecode(net.xmx.velthoric.network.VxByteBuf buf) Decodes a grab result packet from a network buffer.voidencode(net.xmx.velthoric.network.VxByteBuf buf) Encodes the packet data into a network buffer.voidhandle(dev.architectury.networking.NetworkManager.PacketContext context) Handles the grab result on the client side.Methods inherited from class net.timtaran.interactivemc.network.sync.packet.HandInteractionPacket
getInteractionHand
-
Constructor Details
-
S2CGrabResultPacket
public S2CGrabResultPacket(net.minecraft.world.InteractionHand interactionHand, UUID grabbedBodyUUID) Constructs a new grab result packet.- Parameters:
interactionHand- the hand that performed the grabgrabbedBodyUUID- the UUID of the grabbed body, or null if grab failed
-
-
Method Details
-
encode
public void encode(net.xmx.velthoric.network.VxByteBuf buf) Encodes the packet data into a network buffer.- Specified by:
encodein interfacenet.xmx.velthoric.network.IVxNetPacket- Overrides:
encodein classHandInteractionPacket- Parameters:
buf- the buffer to write to
-
decode
Decodes a grab result packet from a network buffer.- Parameters:
buf- the buffer to read from- Returns:
- a new instance of the grab result packet
-
handle
public void handle(dev.architectury.networking.NetworkManager.PacketContext context) Handles the grab result on the client side.Updates the client-side data store with the UUID of the grabbed body.
- Parameters:
context- the packet context containing the player and network info
-