Skip to content

Class: AnvilParser ​

Defined in: packages/minerender/src/world/AnvilParser.ts:77

Reads numeric and paletted Java terrain and entity .mca regions without data-version migration.

Constructors ​

Constructor ​

ts
new AnvilParser(): AnvilParser;

Returns ​

AnvilParser

Methods ​

getChunkList() ​

ts
static getChunkList(data): object[];

Defined in: packages/minerender/src/world/AnvilParser.ts:80

Lists occupied chunk positions within the region, using local coordinates from 0 to 31.

Parameters ​

ParameterType
dataRegionInput

Returns ​

object[]


parse() ​

ts
static parse(data, options?): Promise<AnvilRegion>;

Defined in: packages/minerender/src/world/AnvilParser.ts:85

Decodes all stored chunks. Gzip, zlib, LZ4, and uncompressed payloads are supported.

Parameters ​

ParameterType
dataRegionInput
optionsAnvilParseOptions

Returns ​

Promise<AnvilRegion>


parseChunk() ​

ts
static parseChunk(
   data, 
   localX, 
   localZ, 
   options?
): Promise<AnvilChunk | undefined>;

Defined in: packages/minerender/src/world/AnvilParser.ts:102

Decodes one chunk for MineRenderWorld.placeChunk.

Parameters ​

ParameterTypeDescription
dataRegionInput-
localXnumberChunk x within the region, from 0 to 31.
localZnumberChunk z within the region, from 0 to 31.
optionsAnvilParseOptions-

Returns ​

Promise<AnvilChunk | undefined>

The chunk with absolute coordinates, or undefined if the region has no chunk there.


parseEntityChunk() ​

ts
static parseEntityChunk(
   data, 
   localX, 
   localZ, 
   options?
): Promise<AnvilEntityChunk | undefined>;

Defined in: packages/minerender/src/world/AnvilParser.ts:117

Decodes one chunk from an entities/r.x.z.mca file without migrating its NBT.

Parameters ​

ParameterTypeDescription
dataRegionInput-
localXnumberChunk x within the region, from 0 to 31.
localZnumberChunk z within the region, from 0 to 31.
optionsAnvilParseOptions-

Returns ​

Promise<AnvilEntityChunk | undefined>

The entities with absolute chunk coordinates, or undefined if no chunk is stored there.