Interface ChunkWithLightPacketView

All Superinterfaces:
PacketView

public interface ChunkWithLightPacketView extends PacketView
Lazy zero-copy view of clientbound chunk and light data.
  • Method Details

    • chunkX

      int chunkX()
    • chunkZ

      int chunkZ()
    • chunkData

      NativeValue chunkData()
    • lightData

      NativeValue lightData()
    • replaceBlockState

      boolean replaceBlockState(NativeValue from, NativeValue to)
      Replaces every occurrence of one block state in the serialized chunk sections. Palette data is parsed lazily and copied only when at least one state matches. Air transitions update the native non-empty section counter in the same pass.
      Parameters:
      from - state to replace
      to - replacement state
      Returns:
      whether the payload changed
    • blockState

      boolean blockState(int x, int y, int z, NativeValue state)
      Changes one block using payload-local coordinates. X and Z are in [0, 15]; Y starts at zero in the first serialized section so custom-dimension minimum heights remain unambiguous.
      Parameters:
      x - local X
      y - local Y across all serialized sections
      z - local Z
      state - replacement state
      Returns:
      whether the block changed