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

public class S2CGrabResultPacket extends HandInteractionPacket
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

    Constructors
    Constructor
    Description
    S2CGrabResultPacket(net.minecraft.world.InteractionHand interactionHand, UUID grabbedBodyUUID)
    Constructs a new grab result packet.
  • Method Summary

    Modifier and Type
    Method
    Description
    decode(net.xmx.velthoric.network.VxByteBuf buf)
    Decodes a grab result packet from a network buffer.
    void
    encode(net.xmx.velthoric.network.VxByteBuf buf)
    Encodes the packet data into a network buffer.
    void
    handle(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 grab
      grabbedBodyUUID - 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:
      encode in interface net.xmx.velthoric.network.IVxNetPacket
      Overrides:
      encode in class HandInteractionPacket
      Parameters:
      buf - the buffer to write to
    • decode

      public static S2CGrabResultPacket decode(net.xmx.velthoric.network.VxByteBuf buf)
      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