Class C2STriggerStatePacket
java.lang.Object
net.timtaran.interactivemc.body.player.packet.HandInteractionPacket
net.timtaran.interactivemc.body.player.packet.C2STriggerStatePacket
- All Implemented Interfaces:
net.xmx.velthoric.network.IVxNetPacket
Client-to-Server packet for updating the player's trigger state.
-
Constructor Summary
ConstructorsConstructorDescriptionC2STriggerStatePacket(PlayerBodyPart playerBodyPart, TriggerState triggerState) Constructs a new grab request packet. -
Method Summary
Modifier and TypeMethodDescriptionstatic C2STriggerStatePacketdecode(net.minecraft.network.FriendlyByteBuf buf) Decodes a grab 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 trigger state update packet on the server side.Methods inherited from class net.timtaran.interactivemc.body.player.packet.HandInteractionPacket
getPlayerBodyPartMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.xmx.velthoric.network.IVxNetPacket
release
-
Constructor Details
-
C2STriggerStatePacket
Constructs a new grab request packet.- Parameters:
playerBodyPart- the body part performing the trigger actiontriggerState- the trigger state to set
-
-
Method Details
-
encode
public void encode(net.xmx.velthoric.network.VxByteBuf buf) Description copied from class:HandInteractionPacketEncodes 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 packet from a network buffer.- Parameters:
buf- the buffer to read from- Returns:
- a new instance of the grab packet
-
handle
public void handle(dev.architectury.networking.NetworkManager.PacketContext context) Handles the trigger state update packet on the server side.This method executes on the physics world thread and notifies grabbed body (if any) of the new trigger state.
- Parameters:
context- the packet context containing the player and network info
-