Class ItemToolSpec

java.lang.Object
com.hypixel.hytale.protocol.ItemToolSpec

public class ItemToolSpec extends Object
  • Field Details

    • 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:
    • gatherType

      @Nullable public String gatherType
    • power

      public float power
    • quality

      public int quality
  • Constructor Details

    • ItemToolSpec

      public ItemToolSpec()
    • ItemToolSpec

      public ItemToolSpec(@Nullable String gatherType, float power, int quality)
    • ItemToolSpec

      public ItemToolSpec(@Nonnull ItemToolSpec other)
  • Method Details

    • 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.
    • getGatherType

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

      @Nullable public static String getGatherType(MemorySegment mem, int offset)
    • getPower

      public static float getPower(MemorySegment mem)
    • getPower

      public static float getPower(MemorySegment mem, int offset)
    • getQuality

      public static int getQuality(MemorySegment mem)
    • getQuality

      public static int getQuality(MemorySegment mem, int offset)
    • hasGatherType

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

      public static ItemToolSpec toObject(MemorySegment mem)
    • toObject

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

      public static ItemToolSpec toObject(MemorySegment mem, int offset, @Nullable ReadCursor cursor)
      Decodes one ItemToolSpec 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)
    • computeSize

      public int computeSize()
    • clone

      public ItemToolSpec clone()
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object