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

public class C2STriggerStatePacket extends HandInteractionPacket
Client-to-Server packet for updating the player's trigger state.
  • Constructor Details

    • C2STriggerStatePacket

      public C2STriggerStatePacket(PlayerBodyPart playerBodyPart, TriggerState triggerState)
      Constructs a new grab request packet.
      Parameters:
      playerBodyPart - the body part performing the trigger action
      triggerState - the trigger state to set
  • Method Details

    • encode

      public void encode(net.xmx.velthoric.network.VxByteBuf buf)
      Description copied from class: HandInteractionPacket
      Encodes the packet data into a network buffer.
      Specified by:
      encode in interface net.xmx.velthoric.network.IVxNetPacket
      Overrides:
      encode in class HandInteractionPacket
      Parameters:
      buf - the buffer to write to
    • decode

      public static C2STriggerStatePacket decode(net.minecraft.network.FriendlyByteBuf buf)
      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