Class C2SReleasePacket
java.lang.Object
net.timtaran.interactivemc.network.sync.packet.HandInteractionPacket
net.timtaran.interactivemc.network.sync.packet.C2SReleasePacket
- All Implemented Interfaces:
net.xmx.velthoric.network.IVxNetPacket
Client-to-Server packet requesting a release action.
This packet is sent from the client when a player releases a grabbed object. The server processes this request and removes the grab constraint.
-
Constructor Summary
ConstructorsConstructorDescriptionC2SReleasePacket(net.minecraft.world.InteractionHand interactionHand) Constructs a new release request packet. -
Method Summary
Modifier and TypeMethodDescriptionstatic C2SReleasePacketdecode(net.xmx.velthoric.network.VxByteBuf buf) Decodes a release packet from a network buffer.voidhandle(dev.architectury.networking.NetworkManager.PacketContext context) Handles the release request on the server side.Methods inherited from class net.timtaran.interactivemc.network.sync.packet.HandInteractionPacket
encode, getInteractionHand
-
Constructor Details
-
C2SReleasePacket
public C2SReleasePacket(net.minecraft.world.InteractionHand interactionHand) Constructs a new release request packet.- Parameters:
interactionHand- the hand releasing the grab
-
-
Method Details
-
decode
Decodes a release packet from a network buffer.- Parameters:
buf- the buffer to read from- Returns:
- a new instance of the release packet
-
handle
public void handle(dev.architectury.networking.NetworkManager.PacketContext context) Handles the release request on the server side.This method executes on the physics world thread to ensure thread safety and removes the grab constraint from the grabbed object.
- Parameters:
context- the packet context containing the player and network info
-