Interface NativeChunkPacketHandler


@NullMarked @AsOf("2.0.0") @Internal public interface NativeChunkPacketHandler
Internal handler for NMS-level chunk packet manipulation. Implemented by the NMS module.
Since:
2.0.0
  • Field Details

  • Method Details

    • modifyChunkBiomes

      @AsOf("2.2.0") void modifyChunkBiomes(Object chunkData, ChunkLocation chunkLocation, VirtualBiomeResolver resolver, PacketHandler.DimensionSectionCount dimensionSectionCount)
      Decodes a clientbound chunk packet exactly once, lets the supplied resolver inspect the real biome/block data and choose a custom biome, and only if one is chosen rewrites the packet to use that biome's ID and apply its block replacements.

      If the resolver returns null, the packet is left untouched and no serialization or reflection write occurs.

      Parameters:
      chunkData - the NMS ClientboundLevelChunkPacketData (passed as Object since the API module cannot reference NMS types directly)
      chunkLocation - the chunk being sent, used to build the snapshot view
      resolver - chooses the custom biome to apply based on the decoded chunk data, or returns null to leave the packet unmodified
      dimensionSectionCount - how many sections the dimension has