-
Notifications
You must be signed in to change notification settings - Fork 4
Custom block layers
There are currently two different ways to generate custom block layers into the world. These are especially useful if you want to create smother transitions between the different terrain blocks of adjacent dimensions.
All of these again can be defined in the INIT() section of the config file
add("basicLayer", <dimId>, <block>, [<botStart>, <botFull>, <topFull>, <TopStart>]#);
-
<dimId>: the numerical id of the dimension to generate in. -
<block>: a string representing the block to place in"modId:blockId@meta"-format. The entire height range from<botFull>inclusive to<topFull>exclusive will be filled with the given block. And between<botStart>and<botFull>as well as between<topFull>and<TopStart>the block will fade out similar to how bedrock does, with 100% density at<botFull>/topFulland 0% density at<botStart>/<TopStart>.
If you just want a solid layer without fading effects, just set <botStart> and <botFull> to the same height (the same with <topFull> and <TopStart>).
add("noiseLayer", <dimId>, [<layers>...], <noiseFactor>, <noiseField>, [<minY>, <maxY>]#);
-
<dimId>: the numerical id of the dimension to generate in. -
[<layers>...]: an alternating list of strings representing blocks to place and numbers representing height field thresholds at which to switch between them. -
<noiseFactor>: a number specifying how much the noise field should effect the height field. -
<noiseField>: the name of the noise field used to modify the height field. -
<minY>,<maxY>: the heights between which to place blocks. The base height field (without noise) would be 0.0 at<minY>and 1.0 at<maxY>.
The block generation works by assigning a number to each block location in the chunk within height range <minY> to <maxY>. This number (the height field) consists of a linear interpolation between 0.0 and 1.0 based on height plus the value of the noise field which may randomly fluctuate between - <noiseFactor> and + <noiseFactor> depending on location.
Then the block to be placed for each position is picked from the given [<layers>...] list according to the value of the height field at that position.
For example if the list is ["minecraft:stone", 0.5, "minecraft:dirt", 0.9, "minecraft:air"] then it will place stone blocks everywhere the value is at or below 0.5, dirt blocks where it is at or below 0.9 and air where it is above 0.9.
If no block is given for a specific range as for example in ["minecraft:stone", 0.2, 0.8, "minecraft:stone"] between 0.2 and 0.8 then no block is placed at these values (the blocks would stay as they were before).