Interface NativeChunkPacketHandler
Internal handler for NMS-level chunk packet manipulation. Implemented by the NMS module.
- Since:
- 2.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final WireProvider<NativeChunkPacketHandler> -
Method Summary
Modifier and TypeMethodDescriptionvoidmodifyChunkBiomes(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.
-
Field Details
-
WIRE
-
CHUNK_SECTION_SIZE
static final int CHUNK_SECTION_SIZE- See Also:
-
CHUNK_SECTIONS
static final int CHUNK_SECTIONS- See Also:
-
-
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 viewresolver- chooses the custom biome to apply based on the decoded chunk data, or returnsnullto leave the packet unmodifieddimensionSectionCount- how many sections the dimension has
-