Namespace RegionReader
🏭 Functions
getSection
ts
getSection(region: RegionDataFrame, chunkY: number): RegionSectionDataFrameGet a chunk section in a region by chunk Y value.
Parameters
- region:
RegionDataFrameThe region - chunkY:
numberThe y value of the chunk. It should be from [0, 16)
Return Type
RegionSectionDataFrame
Defined in: packages/game-data/level.ts:231
getSectionBlockIdArray
ts
getSectionBlockIdArray(section: NewRegionSectionDataFrame): number[]Create an array of block ids from the chunk section given
Parameters
- section:
NewRegionSectionDataFrameThe chunk section
Return Type
number[]
Defined in: packages/game-data/level.ts:272
getSectionInformation
ts
getSectionInformation(section: NewRegionSectionDataFrame): { bitLength: number; blockStates: bigint[]; palette: BlockStateData[] }Returns the palette, blockStates and bitLength for a section
Parameters
- section:
NewRegionSectionDataFrameThe chunk section
Return Type
{ bitLength: number; blockStates: bigint[]; palette: BlockStateData[] }
Defined in: packages/game-data/level.ts:240
seekBlockState
ts
seekBlockState(section: NewRegionSectionDataFrame, index: number): BlockStateDataSeek the block state data from new region format.
Parameters
- section:
NewRegionSectionDataFrameThe new region section - index:
numberThe chunk index, which is a number in range [0, 4096)
Return Type
BlockStateData
Defined in: packages/game-data/level.ts:334
seekBlockStateId
ts
seekBlockStateId(section: LegacyRegionSectionDataFrame | NewRegionSectionDataFrame, index: number): numberSeek the section and get the block state id from the section.
Parameters
- section:
LegacyRegionSectionDataFrame | NewRegionSectionDataFrameThe section - index:
numberThe chunk index
Return Type
number
Defined in: packages/game-data/level.ts:313
walkBlockStateId
ts
walkBlockStateId(section: RegionSectionDataFrame, reader: (x: number, y: number, z: number, id: number) => void): voidWalk through all the position in this chunk and emit all the id in every position.
Parameters
- section:
RegionSectionDataFrameThe chunk section - reader:
(x: number, y: number, z: number, id: number) => voidThe callback which will receive the position + state id.
Return Type
void
Defined in: packages/game-data/level.ts:288