Class MouseInteraction

java.lang.Object
com.hypixel.hytale.protocol.packets.player.MouseInteraction
All Implemented Interfaces:
Packet, ToServerPacket

public class MouseInteraction extends Object implements Packet, ToServerPacket
  • Field Details

    • PACKET_ID

      public static final int PACKET_ID
      See Also:
    • IS_COMPRESSED

      public static final boolean IS_COMPRESSED
      See Also:
    • NULLABLE_BIT_FIELD_SIZE

      public static final int NULLABLE_BIT_FIELD_SIZE
      See Also:
    • FIXED_BLOCK_SIZE

      public static final int FIXED_BLOCK_SIZE
      See Also:
    • VARIABLE_FIELD_COUNT

      public static final int VARIABLE_FIELD_COUNT
      See Also:
    • VARIABLE_BLOCK_START

      public static final int VARIABLE_BLOCK_START
      See Also:
    • MAX_SIZE

      public static final int MAX_SIZE
      See Also:
    • clientTimestamp

      public long clientTimestamp
    • activeSlot

      public int activeSlot
    • itemInHandId

      @Nullable public String itemInHandId
    • screenPoint

      @Nonnull public org.joml.Vector2fc screenPoint
    • mouseButton

      @Nullable public MouseButtonEvent mouseButton
    • mouseMotion

      @Nullable public MouseMotionEvent mouseMotion
    • worldInteraction

      @Nullable public WorldInteraction worldInteraction
  • Constructor Details

    • MouseInteraction

      public MouseInteraction()
    • MouseInteraction

      public MouseInteraction(long clientTimestamp, int activeSlot, @Nullable String itemInHandId, @Nonnull org.joml.Vector2fc screenPoint, @Nullable MouseButtonEvent mouseButton, @Nullable MouseMotionEvent mouseMotion, @Nullable WorldInteraction worldInteraction)
    • MouseInteraction

      public MouseInteraction(@Nonnull MouseInteraction other)
  • Method Details

    • getId

      public int getId()
      Description copied from interface: Packet
      Returns the unique packet ID.
      Specified by:
      getId in interface Packet
    • getChannel

      public NetworkChannel getChannel()
      Description copied from interface: Packet
      Returns the channel this packet should be sent on.
      Specified by:
      getChannel in interface Packet
    • requireBounds

      public static void requireBounds(MemorySegment mem, int offset)
      Checks that the fixed block fits. The per-field getters read without their own bound check, so call this once before reading fields out of an untrusted segment.
    • getClientTimestamp

      public static long getClientTimestamp(MemorySegment mem)
    • getClientTimestamp

      public static long getClientTimestamp(MemorySegment mem, int offset)
    • getActiveSlot

      public static int getActiveSlot(MemorySegment mem)
    • getActiveSlot

      public static int getActiveSlot(MemorySegment mem, int offset)
    • getItemInHandId

      @Nullable public static String getItemInHandId(MemorySegment mem)
    • getItemInHandId

      @Nullable public static String getItemInHandId(MemorySegment mem, int offset)
    • getScreenPoint

      public static org.joml.Vector2fc getScreenPoint(MemorySegment mem)
    • getScreenPoint

      public static org.joml.Vector2fc getScreenPoint(MemorySegment mem, int offset)
    • getMouseButton

      @Nullable public static MouseButtonEvent getMouseButton(MemorySegment mem)
    • getMouseButton

      @Nullable public static MouseButtonEvent getMouseButton(MemorySegment mem, int offset)
    • getMouseMotion

      @Nullable public static MouseMotionEvent getMouseMotion(MemorySegment mem)
    • getMouseMotion

      @Nullable public static MouseMotionEvent getMouseMotion(MemorySegment mem, int offset)
    • getWorldInteraction

      @Nullable public static WorldInteraction getWorldInteraction(MemorySegment mem)
    • getWorldInteraction

      @Nullable public static WorldInteraction getWorldInteraction(MemorySegment mem, int offset)
    • hasMouseButton

      public static boolean hasMouseButton(MemorySegment mem, int offset)
    • hasWorldInteraction

      public static boolean hasWorldInteraction(MemorySegment mem, int offset)
    • hasItemInHandId

      public static boolean hasItemInHandId(MemorySegment mem, int offset)
    • hasMouseMotion

      public static boolean hasMouseMotion(MemorySegment mem, int offset)
    • toObject

      public static MouseInteraction toObject(MemorySegment mem)
    • toObject

      public static MouseInteraction toObject(MemorySegment mem, int offset)
    • toObject

      public static MouseInteraction toObject(MemorySegment mem, int offset, @Nullable ReadCursor cursor)
      Decodes one MouseInteraction and reports the end of its encoding through the cursor. The variable block is decoded in field order against a running position, and each offset slot must name that position, so the fields decoded are the bytes walked.
    • serialize

      public int serialize(@Nonnull MemorySegment mem, int offset)
      Description copied from interface: Packet
      Writes this packet at offset and returns the number of bytes written, which callers rely on being exactly Packet.computeSize(). The framed write path reserves and length-prefixes on that figure before serializing, so a shorter or longer write corrupts the frame rather than failing.
      Specified by:
      serialize in interface Packet
    • computeSize

      public int computeSize()
      Description copied from interface: Packet
      Compute the exact number of bytes needed to serialize this packet.
      Specified by:
      computeSize in interface Packet
    • clone

      public MouseInteraction clone()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object