ChunkReader

class ChunkReader constructor(chunkData: NBTCompound)

Extracts chunk data from a NBTCompound. Does not cache nor convert the raw data. Use when you want to read parts of a chunk without having the memory overhead of ChunkColumn.

Only two piece of information are cached with this object: the data version of the chunk, which is used to know how to extract the chunk data, and the input NBT.

Can throw AnvilException if the NBT data is not recognized or incomplete.

For information on what the different fields extracted from the NBT are, see Chunk Format on the Minecraft wiki

Constructors

ChunkReader
Link copied to clipboard
fun ChunkReader(chunkData: NBTCompound)

Functions

getAirCarvingMask
Link copied to clipboard
fun getAirCarvingMask(): ImmutableByteArray?
Can return null if none found.
getBlockEntities
Link copied to clipboard
fun getBlockEntities(): NBTList<NBTCompound>
getCarvingMasks
Link copied to clipboard
fun getCarvingMasks(): NBTCompound?
Can return null if none found.
getChunkX
Link copied to clipboard
fun getChunkX(): Int
getChunkZ
Link copied to clipboard
fun getChunkZ(): Int
getDataVersion
Link copied to clipboard
fun getDataVersion(): Int
Returns the data version of the input chunk
getGenerationStatus
Link copied to clipboard
fun getGenerationStatus(): ChunkColumn.GenerationStatus
getHeightmaps
Link copied to clipboard
fun getHeightmaps(): NBTCompound?
Can return null if none found.
getInhabitedTime
Link copied to clipboard
fun getInhabitedTime(): Long
getLastUpdate
Link copied to clipboard
fun getLastUpdate(): Long
getLights
Link copied to clipboard
fun getLights(): NBTList<NBTList<NBTShort>>?
Can return null if none found
getLiquidCarvingMask
Link copied to clipboard
fun getLiquidCarvingMask(): ImmutableByteArray?
Can return null if none found.
getLiquidTicks
Link copied to clipboard
fun getLiquidTicks(): NBTList<NBTCompound>
getMinecraftVersion
Link copied to clipboard
fun getMinecraftVersion(): SupportedVersion
Returns a minimum Minecraft version this chunk might come from.
getMotionBlockingHeightmap
Link copied to clipboard
fun getMotionBlockingHeightmap(): ImmutableLongArray?
Can return null if none found.
getMotionBlockingNoLeavesHeightmap
Link copied to clipboard
fun getMotionBlockingNoLeavesHeightmap(): ImmutableLongArray?
Can return null if none found.
getOceanFloorHeightmap
Link copied to clipboard
fun getOceanFloorHeightmap(): ImmutableLongArray?
Can return null if none found.
getOceanFloorWorldGenHeightmap
Link copied to clipboard
fun getOceanFloorWorldGenHeightmap(): ImmutableLongArray?
Can return null if none found.
getOldBiomes
Link copied to clipboard
fun getOldBiomes(): ImmutableIntArray?
Can return null if none found.
getOldEntities
Link copied to clipboard
fun getOldEntities(): NBTList<NBTCompound>
Older chunks (pre 1.17) store entities inside the region/ *.
getOldLiquidsToBeTicked
Link copied to clipboard
fun getOldLiquidsToBeTicked(): NBTList<NBTList<NBTShort>>?
Can return null if none found.
getOldToBeTicked
Link copied to clipboard
fun getOldToBeTicked(): NBTList<NBTList<NBTShort>>?
Can return null if none found.
getPostProcessing
Link copied to clipboard
fun getPostProcessing(): NBTList<NBTList<NBTShort>>?
Can return null if none found
getSections
Link copied to clipboard
fun getSections(): NBTList<NBTCompound>
getStructures
Link copied to clipboard
fun getStructures(): NBTCompound?
Can return null if none found
getTileEntities
Link copied to clipboard
fun getTileEntities(): NBTList<NBTCompound>
Alternative name for getBlockEntities
getTileTicks
Link copied to clipboard
fun getTileTicks(): NBTList<NBTCompound>
getWorldSurfaceHeightmap
Link copied to clipboard
fun getWorldSurfaceHeightmap(): ImmutableLongArray?
Can return null if none found.
getWorldSurfaceWorldGenHeightmap
Link copied to clipboard
fun getWorldSurfaceWorldGenHeightmap(): ImmutableLongArray?
Can return null if none found.
getYRange
Link copied to clipboard
fun getYRange(): IntRange
hasHeightmaps
Link copied to clipboard
fun hasHeightmaps(): Boolean
Returns true iif this chunk has heightmap data
isLightOn
Link copied to clipboard
fun isLightOn(): Boolean
readSectionBiomes
Link copied to clipboard
fun readSectionBiomes(chunkSectionReader: ChunkSectionReader): SectionBiomeInformation?
Can return null if none found.

Properties

chunkData
Link copied to clipboard
val chunkData: NBTCompound