Skip to content

API reference / @jsprismarine/prismarine / world/generators/datadriven/javaBlending / OldChunks

Class: OldChunks ​

Defined in: packages/prismarine/src/world/generators/datadriven/javaBlending.ts:206

The old chunks of one dimension's save, as the generator asks about them.

Both answers are cached up to a bound and asked again after that. Asking again gives the same answer for whether a position is old, because a stored chunk never stops being old and a position the save does not hold only ever becomes a new chunk. A record recalculated after it was dropped reads the chunk's blocks again, as Java recalculates them each time it loads a chunk.

Constructors ​

Constructor ​

new OldChunks(stored, oracle, fallbackBiome): OldChunks

Defined in: packages/prismarine/src/world/generators/datadriven/javaBlending.ts:213

Parameters ​

stored ​

StoredChunkReader

oracle ​

BlockOracle

fallbackBiome ​

BiomeResolver

Returns ​

OldChunks

Methods ​

anyWithin() ​

anyWithin(chunkX, chunkZ, radius): boolean

Defined in: packages/prismarine/src/world/generators/datadriven/javaBlending.ts:251

Whether any old chunk lies within a square radius of a chunk.

Parameters ​

chunkX ​

number

chunkZ ​

number

radius ​

number

Returns ​

boolean


isOld() ​

isOld(chunkX, chunkZ): boolean

Defined in: packages/prismarine/src/world/generators/datadriven/javaBlending.ts:220

Whether the stored chunk at a position is old generation.

Parameters ​

chunkX ​

number

chunkZ ​

number

Returns ​

boolean


recordsAround() ​

recordsAround(chunkX, chunkZ, radius?): OldChunkRecord[] | undefined

Defined in: packages/prismarine/src/world/generators/datadriven/javaBlending.ts:267

The records of the old chunks within a square radius of a chunk, or undefined when there are none, which is the common case and costs no record at all.

Parameters ​

chunkX ​

number

chunkZ ​

number

radius? ​

number = BLENDING_RECORD_RADIUS

BLENDING_RECORD_RADIUS for one chunk; one more for a feature pass, whose view reaches the chunks around it.

Returns ​

OldChunkRecord[] | undefined