API reference / @jsprismarine/prismarine / world/GeneratorFactories
world/GeneratorFactories
Classes
Interfaces
GeneratorBuildContext
Defined in: prismarine/src/world/GeneratorFactories.ts:20
Everything a factory may read while building one dimension's generator.
Properties
completionQueue?
readonlyoptionalcompletionQueue?:ChunkCompletionScheduler
Defined in: prismarine/src/world/GeneratorFactories.ts:39
Server-wide tick queue for non-gameplay work that finishes a generated chunk.
content
readonlycontent: () =>ServerContent
Defined in: prismarine/src/world/GeneratorFactories.ts:28
The server's loaded content, read when a block is placed.
Returns
ServerContent
dimension
readonlydimension:DimensionType
Defined in: prismarine/src/world/GeneratorFactories.ts:24
The dimension the generator fills, whose bounds every chunk takes.
host?
readonlyoptionalhost?:"process"|"in-process"
Defined in: prismarine/src/world/GeneratorFactories.ts:53
Where the workers run: process asks for a separate low-priority generation process and falls back to threads when it cannot start one. Absent means threads in this process.
logger
readonlylogger:GeneratorLogger
Defined in: prismarine/src/world/GeneratorFactories.ts:37
Where a factory or its generator reports a decision a person should see.
seed
readonlyseed:bigint
Defined in: prismarine/src/world/GeneratorFactories.ts:26
The world seed. A generator that is seeded per chunk request may ignore it.
stem
readonlystem:LevelStem
Defined in: prismarine/src/world/GeneratorFactories.ts:22
The stem naming the generator kind and its settings.
terrainCache?
readonlyoptionalterrainCache?:TerrainCacheSettings
Defined in: prismarine/src/world/GeneratorFactories.ts:60
Where generated terrain tiles are kept between runs, and how much room they may take.
Absent keeps every tile in memory only. Like workers, the noise factory reads it once, from the first stem it builds, because one generator serves every dimension.
workers?
readonlyoptionalworkers?:number
Defined in: prismarine/src/world/GeneratorFactories.ts:48
How many worker threads the generator may start.
Defaults to the host's share, min(6, cores - 2). Zero keeps generation on the calling thread, which is what a test wants and what a host too small for a worker gets anyway. The noise factory shares one pool between every stem it builds, so the first stem's value sizes it and later ones are not read.
worldgen
readonlyworldgen: () =>JavaWorldgenRegistries
Defined in: prismarine/src/world/GeneratorFactories.ts:35
Java's world generation registries.
A function, because reading them costs about 1500 JSON files and a flat or void dimension never needs them. Throws when the Java data is not on disk.
Returns
JavaWorldgenRegistries
GeneratorFactory
Defined in: prismarine/src/world/GeneratorFactories.ts:74
Builds the generator for one kind of stem.
Properties
kind
readonlykind:string
Defined in: prismarine/src/world/GeneratorFactories.ts:76
The generator kind this factory answers, as a stem's generator.type spells it.
Methods
build()
build(
context):Generator
Defined in: prismarine/src/world/GeneratorFactories.ts:83
Builds a generator for one dimension.
Parameters
context
Returns
Generator
Throws
When the stem's settings cannot be honored, which is the moment a misconfigured world should fail rather than at its first chunk.
TerrainCacheSettings
Defined in: prismarine/src/world/GeneratorFactories.ts:64
A disk budget for generated terrain tiles.
Properties
codeVersion
readonlycodeVersion:string
Defined in: prismarine/src/world/GeneratorFactories.ts:70
Identifies the code that builds the tiles, so an upgrade does not reuse older records.
directory
readonlydirectory:string
Defined in: prismarine/src/world/GeneratorFactories.ts:66
A directory used only for terrain records.
maxBytes
readonlymaxBytes:number
Defined in: prismarine/src/world/GeneratorFactories.ts:68
The most bytes the records may take.