Skip to content

API reference / @jsprismarine/native-worldgen / NativeWorldgen

NativeWorldgen ​

Classes ​

Interfaces ​

NativeAquiferSource ​

Defined in: NativeWorldgen.ts:204

What NativeWorldgen.createAquifer needs: @jsprismarine/worldgen's noise aquifer for one chunk extent.

Properties ​

defaultFluid ​

readonly defaultFluid: number

Defined in: NativeWorldgen.ts:220

One of NativeFluid's codes but none.

extent ​

readonly extent: readonly [number, number, number, number, number, number]

Defined in: NativeWorldgen.ts:217

The lowest block x, y and z of the extent, then the highest, inclusive.

programs ​

readonly programs: readonly [NativeDensityProgram, NativeDensityProgram, NativeDensityProgram, NativeDensityProgram, NativeDensityProgram, NativeDensityProgram]

Defined in: NativeWorldgen.ts:206

The barrier, floodedness, spread, lava, exclusion and surface level programs, in that order.

seaLevel ​

readonly seaLevel: number

Defined in: NativeWorldgen.ts:218

seedLanes ​

readonly seedLanes: readonly [number, number, number, number]

Defined in: NativeWorldgen.ts:215

The aquifer's Xoroshiro positional seed as four unsigned 32-bit lanes, low half first.

skipSamplingAboveY ​

readonly skipSamplingAboveY: number

Defined in: NativeWorldgen.ts:222

The highest y the aquifer samples cells for.


NativeCellSource ​

Defined in: NativeWorldgen.ts:233

A cell program, as @jsprismarine/worldgen's CellProgram lays a density tree out: records of CELL_WORDS words, root first, the constants they name, how many interpolated cells they read, and the cell's size.

Properties ​

cellCount ​

readonly cellCount: number

Defined in: NativeWorldgen.ts:236

constants ​

readonly constants: Float64Array

Defined in: NativeWorldgen.ts:235

nodes ​

readonly nodes: Int32Array

Defined in: NativeWorldgen.ts:234

xz ​

readonly xz: number

Defined in: NativeWorldgen.ts:237

y ​

readonly y: number

Defined in: NativeWorldgen.ts:238


NativeClimateSource ​

Defined in: NativeWorldgen.ts:246

A climate search tree, as @jsprismarine/worldgen's climate index flattens it: per node, seven min/max pairs in bounds, its child range, its leaf value index (-1 for a subtree) and its first leaf rank, then the child list.

Properties ​

bounds ​

readonly bounds: Float64Array

Defined in: NativeWorldgen.ts:247

childCounts ​

readonly childCounts: Uint32Array

Defined in: NativeWorldgen.ts:249

children ​

readonly children: Uint32Array

Defined in: NativeWorldgen.ts:252

childStarts ​

readonly childStarts: Uint32Array

Defined in: NativeWorldgen.ts:248

firstLeafRanks ​

readonly firstLeafRanks: Uint32Array

Defined in: NativeWorldgen.ts:251

maxDepth ​

readonly maxDepth: number

Defined in: NativeWorldgen.ts:254

The most nodes from the root through one leaf.

valueIndices ​

readonly valueIndices: Int32Array

Defined in: NativeWorldgen.ts:250


NativeNoiseLayer ​

Defined in: NativeWorldgen.ts:278

One octave of a noise stack, as @jsprismarine/worldgen's NoiseStack holds it: a Perlin noise's permutation table and offsets, the factor its coordinates are scaled by, and its weight.

Properties ​

amplitude ​

readonly amplitude: number

Defined in: NativeWorldgen.ts:286

The octave's weight, a single-precision value.

frequency ​

readonly frequency: number

Defined in: NativeWorldgen.ts:284

offsetX ​

readonly offsetX: number

Defined in: NativeWorldgen.ts:281

offsetY ​

readonly offsetY: number

Defined in: NativeWorldgen.ts:282

offsetZ ​

readonly offsetZ: number

Defined in: NativeWorldgen.ts:283

permutation ​

readonly permutation: ArrayLike<number>

Defined in: NativeWorldgen.ts:280

The 256-entry permutation table.

smearY? ​

readonly optional smearY?: number

Defined in: NativeWorldgen.ts:291

SmearedPerlinNoise's fudgeYScale: the step the lattice's y fraction snaps down to, as old blended noise samples. Absent or 0 for plain Perlin noise.


NativeProgramSource ​

Defined in: NativeWorldgen.ts:265

A density program, as @jsprismarine/worldgen encodes a density function tree: records of PROGRAM_WORDS words, root first, with the constants, link lists and noise stacks they name, and the number of memo slots its caches use.

Properties ​

cacheSlots ​

readonly cacheSlots: number

Defined in: NativeWorldgen.ts:271

constants ​

readonly constants: Float64Array

Defined in: NativeWorldgen.ts:267

readonly links: Int32Array

Defined in: NativeWorldgen.ts:268

nodes ​

readonly nodes: Int32Array

Defined in: NativeWorldgen.ts:266

stacks ​

readonly stacks: readonly NativeNoiseStack[]

Defined in: NativeWorldgen.ts:270

The stacks its noise records sample; they have to outlive the program.


NativeSurfaceSource ​

Defined in: NativeWorldgen.ts:173

What NativeWorldgen.createSurface needs: a material rule program laid out for the C.

Properties ​

biomeSets ​

readonly biomeSets: Uint32Array

Defined in: NativeWorldgen.ts:179

The biome conditions' membership bitsets, biomeWords words each.

biomeWords ​

readonly biomeWords: number

Defined in: NativeWorldgen.ts:180

conditions ​

readonly conditions: Float64Array

Defined in: NativeWorldgen.ts:177

NativeSurfaceLayout.conditionDoubles doubles per condition.

ops ​

readonly ops: Int32Array

Defined in: NativeWorldgen.ts:175

The program's ops, three words each.

programs ​

readonly programs: readonly NativeDensityProgram[]

Defined in: NativeWorldgen.ts:184

The density, richness and gap programs the vein records name, kept alive with the program.

stateCount ​

readonly stateCount: number

Defined in: NativeWorldgen.ts:185

veins ​

readonly veins: Float64Array

Defined in: NativeWorldgen.ts:182

NativeSurfaceLayout.veinDoubles doubles per ore vein.

zoomSeed ​

readonly zoomSeed: readonly [number, number]

Defined in: NativeWorldgen.ts:187

The biome jitter seed's unsigned high and low 32 bits.

Variables ​

ABI_VERSION ​

const ABI_VERSION: 1 = 1

Defined in: NativeWorldgen.ts:9

The interface version this binding speaks; it must equal the library's JWG_ABI_VERSION.


CELL_WORDS ​

const CELL_WORDS: 6 = 6

Defined in: NativeWorldgen.ts:226

The 32-bit words of one cell program record, JWG_CELL_WORDS in the C.


NativeFluid ​

const NativeFluid: object

Defined in: NativeWorldgen.ts:191

The fluid codes NativeAquifer.fill writes, JWG_FLUID_* in the C.

Type Declaration ​

air ​

readonly air: 0 = 0

lava ​

readonly lava: 2 = 2

none ​

readonly none: 4 = 4

No fluid: the position keeps the dimension's default block.

other ​

readonly other: 3 = 3

The dimension's default fluid when it is neither water, lava nor air.

schedule ​

readonly schedule: 128 = 0x80

Set on a code whose position wants a fluid tick.

water ​

readonly water: 1 = 1


NativeSurfaceCondition ​

const NativeSurfaceCondition: object

Defined in: NativeWorldgen.ts:156

The condition record types of the surface program.

Type Declaration ​

abovePreliminarySurface ​

readonly abovePreliminarySurface: 8 = 8

biome ​

readonly biome: 0 = 0

hole ​

readonly hole: 7 = 7

noise ​

readonly noise: 1 = 1

steep ​

readonly steep: 6 = 6

stoneDepth ​

readonly stoneDepth: 9 = 9

unanswered ​

readonly unanswered: 10 = 10

A condition the C does not answer, such as temperature; the block falls back.

verticalGradient ​

readonly verticalGradient: 2 = 2

verticalGradientLegacy ​

readonly verticalGradientLegacy: 11 = 11

A vertical gradient drawing from Java's legacy random source.

water ​

readonly water: 4 = 4

yAbove ​

readonly yAbove: 3 = 3


NativeSurfaceLayout ​

const NativeSurfaceLayout: object

Defined in: NativeWorldgen.ts:136

The layout of the surface program's records and results, JWG_SURFACE_* in the C.

Type Declaration ​

barren ​

readonly barren: 1 = 1

A vein cell whose density cannot be positive anywhere.

columnFields ​

readonly columnFields: 6 = 6

conditionDoubles ​

readonly conditionDoubles: 8 = 8

conditionPerColumn ​

readonly conditionPerColumn: 7 = 7

The condition record's word that is nonzero for a condition that reads the column alone.

fallback ​

readonly fallback: -2 = -2

A block that reached a condition the C does not answer, which the TypeScript runs.

fallbackFields ​

readonly fallbackFields: 4 = 4

The doubles of one fallback entry: block index, stone depth above and below, water height.

frameFields ​

readonly frameFields: 18 = 18

noWater ​

readonly noWater: -2147483648 = -2147483648

The water height a fallback entry gives where no fluid sits above.

unchanged ​

readonly unchanged: -1 = -1

A block the rule leaves alone.

veinDoubles ​

readonly veinDoubles: 12 = 12


PROGRAM_WORDS ​

const PROGRAM_WORDS: 6 = 6

Defined in: NativeWorldgen.ts:258

The 32-bit words of one density program record, JWG_PROGRAM_WORDS in the C.