Class BlockMatcher

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

public class BlockMatcher extends Object
  • Field Details

  • Constructor Details

    • BlockMatcher

      public BlockMatcher()
    • BlockMatcher

      public BlockMatcher(@Nullable BlockIdMatcher block, @Nonnull BlockFace face, boolean staticFace)
    • BlockMatcher

      public BlockMatcher(@Nonnull BlockMatcher 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.
    • getBlock

      @Nullable public static BlockIdMatcher getBlock(MemorySegment mem)
    • getBlock

      @Nullable public static BlockIdMatcher getBlock(MemorySegment mem, int offset)
    • getFace

      public static BlockFace getFace(MemorySegment mem)
    • getFace

      public static BlockFace getFace(MemorySegment mem, int offset)
    • getStaticFace

      public static boolean getStaticFace(MemorySegment mem)
    • getStaticFace

      public static boolean getStaticFace(MemorySegment mem, int offset)
    • hasBlock

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

      public static BlockMatcher toObject(MemorySegment mem)
    • toObject

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

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object