API reference / @jsprismarine/native-worldgen / NativeWorldgen
NativeWorldgen
Classes
- NativeAquifer
- NativeCellProgram
- NativeClimateSearch
- NativeDensityProgram
- NativeNoiseStack
- NativeSurface
- NativeWorldgen
Interfaces
NativeAquiferSource
Defined in: NativeWorldgen.ts:204
What NativeWorldgen.createAquifer needs: @jsprismarine/worldgen's noise aquifer for one chunk extent.
Properties
defaultFluid
readonlydefaultFluid:number
Defined in: NativeWorldgen.ts:220
One of NativeFluid's codes but none.
extent
readonlyextent: 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
readonlyprograms: 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
readonlyseaLevel:number
Defined in: NativeWorldgen.ts:218
seedLanes
readonlyseedLanes: 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
readonlyskipSamplingAboveY: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
readonlycellCount:number
Defined in: NativeWorldgen.ts:236
constants
readonlyconstants:Float64Array
Defined in: NativeWorldgen.ts:235
nodes
readonlynodes:Int32Array
Defined in: NativeWorldgen.ts:234
xz
readonlyxz:number
Defined in: NativeWorldgen.ts:237
y
readonlyy: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
readonlybounds:Float64Array
Defined in: NativeWorldgen.ts:247
childCounts
readonlychildCounts:Uint32Array
Defined in: NativeWorldgen.ts:249
children
readonlychildren:Uint32Array
Defined in: NativeWorldgen.ts:252
childStarts
readonlychildStarts:Uint32Array
Defined in: NativeWorldgen.ts:248
firstLeafRanks
readonlyfirstLeafRanks:Uint32Array
Defined in: NativeWorldgen.ts:251
maxDepth
readonlymaxDepth:number
Defined in: NativeWorldgen.ts:254
The most nodes from the root through one leaf.
valueIndices
readonlyvalueIndices: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
readonlyamplitude:number
Defined in: NativeWorldgen.ts:286
The octave's weight, a single-precision value.
frequency
readonlyfrequency:number
Defined in: NativeWorldgen.ts:284
offsetX
readonlyoffsetX:number
Defined in: NativeWorldgen.ts:281
offsetY
readonlyoffsetY:number
Defined in: NativeWorldgen.ts:282
offsetZ
readonlyoffsetZ:number
Defined in: NativeWorldgen.ts:283
permutation
readonlypermutation:ArrayLike<number>
Defined in: NativeWorldgen.ts:280
The 256-entry permutation table.
smearY?
readonlyoptionalsmearY?: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
readonlycacheSlots:number
Defined in: NativeWorldgen.ts:271
constants
readonlyconstants:Float64Array
Defined in: NativeWorldgen.ts:267
links
readonlylinks:Int32Array
Defined in: NativeWorldgen.ts:268
nodes
readonlynodes:Int32Array
Defined in: NativeWorldgen.ts:266
stacks
readonlystacks: readonlyNativeNoiseStack[]
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
readonlybiomeSets:Uint32Array
Defined in: NativeWorldgen.ts:179
The biome conditions' membership bitsets, biomeWords words each.
biomeWords
readonlybiomeWords:number
Defined in: NativeWorldgen.ts:180
conditions
readonlyconditions:Float64Array
Defined in: NativeWorldgen.ts:177
NativeSurfaceLayout.conditionDoubles doubles per condition.
ops
readonlyops:Int32Array
Defined in: NativeWorldgen.ts:175
The program's ops, three words each.
programs
readonlyprograms: readonlyNativeDensityProgram[]
Defined in: NativeWorldgen.ts:184
The density, richness and gap programs the vein records name, kept alive with the program.
stateCount
readonlystateCount:number
Defined in: NativeWorldgen.ts:185
veins
readonlyveins:Float64Array
Defined in: NativeWorldgen.ts:182
NativeSurfaceLayout.veinDoubles doubles per ore vein.
zoomSeed
readonlyzoomSeed: readonly [number,number]
Defined in: NativeWorldgen.ts:187
The biome jitter seed's unsigned high and low 32 bits.
Variables
ABI_VERSION
constABI_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
constCELL_WORDS:6=6
Defined in: NativeWorldgen.ts:226
The 32-bit words of one cell program record, JWG_CELL_WORDS in the C.
NativeFluid
constNativeFluid:object
Defined in: NativeWorldgen.ts:191
The fluid codes NativeAquifer.fill writes, JWG_FLUID_* in the C.
Type Declaration
air
readonlyair:0=0
lava
readonlylava:2=2
none
readonlynone:4=4
No fluid: the position keeps the dimension's default block.
other
readonlyother:3=3
The dimension's default fluid when it is neither water, lava nor air.
schedule
readonlyschedule:128=0x80
Set on a code whose position wants a fluid tick.
water
readonlywater:1=1
NativeSurfaceCondition
constNativeSurfaceCondition:object
Defined in: NativeWorldgen.ts:156
The condition record types of the surface program.
Type Declaration
abovePreliminarySurface
readonlyabovePreliminarySurface:8=8
biome
readonlybiome:0=0
hole
readonlyhole:7=7
noise
readonlynoise:1=1
steep
readonlysteep:6=6
stoneDepth
readonlystoneDepth:9=9
unanswered
readonlyunanswered:10=10
A condition the C does not answer, such as temperature; the block falls back.
verticalGradient
readonlyverticalGradient:2=2
verticalGradientLegacy
readonlyverticalGradientLegacy:11=11
A vertical gradient drawing from Java's legacy random source.
water
readonlywater:4=4
yAbove
readonlyyAbove:3=3
NativeSurfaceLayout
constNativeSurfaceLayout:object
Defined in: NativeWorldgen.ts:136
The layout of the surface program's records and results, JWG_SURFACE_* in the C.
Type Declaration
barren
readonlybarren:1=1
A vein cell whose density cannot be positive anywhere.
columnFields
readonlycolumnFields:6=6
conditionDoubles
readonlyconditionDoubles:8=8
conditionPerColumn
readonlyconditionPerColumn:7=7
The condition record's word that is nonzero for a condition that reads the column alone.
fallback
readonlyfallback:-2=-2
A block that reached a condition the C does not answer, which the TypeScript runs.
fallbackFields
readonlyfallbackFields:4=4
The doubles of one fallback entry: block index, stone depth above and below, water height.
frameFields
readonlyframeFields:18=18
noWater
readonlynoWater:-2147483648=-2147483648
The water height a fallback entry gives where no fluid sits above.
unchanged
readonlyunchanged:-1=-1
A block the rule leaves alone.
veinDoubles
readonlyveinDoubles:12=12
PROGRAM_WORDS
constPROGRAM_WORDS:6=6
Defined in: NativeWorldgen.ts:258
The 32-bit words of one density program record, JWG_PROGRAM_WORDS in the C.