GenerationUtils
Index
Interfaces
IMinableParams
data
Ore block data.
id
Ore block numeric identifier.
optionalnoStoneCheck
If true
, no check for stone is performed so the ore may be
generated in the air. Use this to debug ore generation in
the superflat worlds.
MinableAmountParams
amount
Amount of the ore to be generated, minimum allowed value is 1
.
Use at least 6
to be able to find generated ore vein.
Note that amount doesn't mean blocks count, it is just an
input value for generation algorithm.
data
Ore block data.
id
Ore block numeric identifier.
optionalnoStoneCheck
If true
, no check for stone is performed so the ore may be
generated in the air. Use this to debug ore generation in
the superflat worlds.
MinableSizeParams
data
Ore block data.
id
Ore block numeric identifier.
optionalnoStoneCheck
If true
, no check for stone is performed so the ore may be
generated in the air. Use this to debug ore generation in
the superflat worlds.
optionalratio
Amount ratio of ore vein per generation chunk.
size
Used to calculate amount, using simple formula size * ratio * 3
.
Minimum allowed value of amount is 1
.
Type Aliases
MinableParams
Functions
canSeeSky
Parameters
x: number
y: number
z: number
Returns boolean
true
, if one can see sky from the specified position,false
otherwise.
findHighSurface
Finds limited to
y=128
coordinate empty space on the specified x and z coordinates.Parameters
x: number
z: number
Returns Vector
findLowSurface
Finds limited to
y=64
coordinate empty space on the specified x and z coordinates.Parameters
x: number
z: number
Returns Vector
findSurface
Finds limited to the specified y coordinate empty space on the specified x and z coordinates.
Parameters
x: number
y: number
z: number
Returns Vector
genMinable
Generates ore vein on the specified coordinates using specified params.
Parameters
x: number
y: number
z: number
params: MinableParams
vein generation params
Returns void
generateOre
Generates ore vein on the specified coordinates.
Parameters
x: number
y: number
z: number
id: number
ore block ID
data: number
ore block data
amount: number
ore amount, use at least
6
to be able to find generated ore vein; note that amount doesn't mean blocks count, it is just an input value for generation algorithmnoStoneCheck: boolean
if
true
, no check for stone is performed so the ore may be generated in the air; use this to debug ore generation in the superflat worlds
Returns void
generateOreCustom
Generates ore vein on the specified coordinates with custom whitelist/blacklist.
Parameters
x: number
y: number
z: number
id: number
ore block ID
data: number
ore block data
amount: number
ore amount, use at least
6
to be able to find generated ore vein; note that amount doesn't mean blocks count, it is just an input value for generation algorithmwhitelist: boolean
if
true
, specified block IDs are used as whitelist for generation (only the IDs from the list can be replaced with ores); iffalse
, specified block IDs are used as a blacklist (only the IDs from the list canNOT be replaced with ores)listOfIds: number[]
array of block IDs to be used as whitelist or blacklist
Returns void
getPerlinNoise
Retrieves perlin noise value at the specified coordinates.
Parameters
x: number
y: number
z: number
optionalseed: number
integer random generator seed. If not specified or set to 0, the default constant value is used
optionalscale: number
noise size, to set the main octave size, use 1 / octave size
optionalnumOctaves: number
number of octaves, the more octaves you use, the more detailed is the generated noise. The next octave is two times smaller then the previous one
Returns number
isTerrainBlock
Parameters
id: number
numeric tile ID
Returns boolean
true
if block is solid and light blocking block,false
otherwise.
isTransparentBlock
Parameters
id: number
numeric tile ID
Returns boolean
true
if block is transparent,false
otherwise.
randomCoords
Generates random coordinates inside specified chunk.
Parameters
cx: number
chunk x coordinate
cz: number
chunk z coordinate
optionallowest: number
lowest possible y coordinate; default is
0
optionalhighest: number
highest possible y coordinate; default is
128
Returns Vector
randomXZ
Generates random x and z coordinates inside specified chunk.
Parameters
cx: number
chunk x coordinate
cz: number
chunk z coordinate
Returns { x: number; z: number }
x: number
z: number
Module used to simplify generation tasks in mods logic.