From c987bbd34fd9ccf3571c272d198821ad774e3c68 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 24 Sep 2024 22:06:37 +0300 Subject: [PATCH] add biomes.json --- res/generators/default.lua | 69 +----------------------------- res/generators/default/biomes.json | 68 +++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 68 deletions(-) create mode 100644 res/generators/default/biomes.json diff --git a/res/generators/default.lua b/res/generators/default.lua index 1d658b34..6eeee14a 100644 --- a/res/generators/default.lua +++ b/res/generators/default.lua @@ -4,74 +4,7 @@ sea_level = 64 -- 2 - humidity biome_parameters = 2 -biomes = { - plains = { - parameters = { - {value=0.5, weight=0.6}, - {value=0.5, weight=0.6}, - }, - sea_layers = { - {block="base:water", height=-1}, - }, - layers = { - {block="base:grass_block", height=1, below_sea_level=false}, - {block="base:dirt", height=5, below_sea_level=false}, - {block="base:stone", height=-1}, - {block="base:bazalt", height=1}, - }, - plant_chance = 0.3, - plants = { - {block="base:grass", weight=1}, - {block="base:flower", weight=0.03}, - }, - structure_chance = 0.0001, - structures = { - {name="tree0", weight=1}, - {name="tree1", weight=1}, - } - }, - desert = { - parameters = { - {value=0.0, weight=0.1}, - {value=0.0, weight=0.1}, - }, - sea_layers = { - {block="base:water", height=-1}, - }, - layers = { - {block="base:sand", height=6}, - {block="base:stone", height=-1}, - {block="base:bazalt", height=1}, - } - }, - forest = { - parameters = { - {value=1.0, weight=1.0}, - {value=0.2, weight=0.5}, - }, - sea_layers = { - {block="base:water", height=-1}, - }, - layers = { - {block="base:grass_block", height=1, below_sea_level=false}, - {block="base:dirt", height=7, below_sea_level=false}, - {block="base:stone", height=-1}, - {block="base:bazalt", height=1}, - }, - plant_chance = 0.4, - plants = { - {block="base:grass", weight=1}, - {block="base:flower", weight=0.03}, - }, - structure_chance = 0.032, - structures = { - {name="tree0", weight=1}, - {name="tree1", weight=1}, - {name="tree2", weight=1}, - {name="tower", weight=0.002}, - } - } -} +biomes = json.parse(file.read("core:generators/default/biomes.json")) function place_structures(x, z, w, d, seed, hmap) local placements = {} diff --git a/res/generators/default/biomes.json b/res/generators/default/biomes.json new file mode 100644 index 00000000..52b39eae --- /dev/null +++ b/res/generators/default/biomes.json @@ -0,0 +1,68 @@ +{ + "forest": { + "parameters": [ + {"weight": 1, "value": 1}, + {"weight": 0.5, "value": 0.2} + ], + "layers": [ + {"below_sea_level": false, "height": 1, "block": "base:grass_block"}, + {"below_sea_level": false, "height": 7, "block": "base:dirt"}, + {"height": -1, "block": "base:stone"}, + {"height": 1, "block": "base:bazalt"} + ], + "sea_layers": [ + {"height": -1, "block": "base:water"} + ], + "plant_chance": 0.4, + "plants": [ + {"weight": 1, "block": "base:grass"}, + {"weight": 0.03, "block": "base:flower"} + ], + "structure_chance": 0.032, + "structures": [ + {"name": "tree0", "weight": 1}, + {"name": "tree1", "weight": 1}, + {"name": "tree2", "weight": 1}, + {"name": "tower", "weight": 0.002} + ] + }, + "desert": { + "parameters": [ + {"weight": 0.1, "value": 0}, + {"weight": 0.1, "value": 0} + ], + "layers": [ + {"height": 6, "block": "base:sand"}, + {"height": -1, "block": "base:stone"}, + {"height": 1, "block": "base:bazalt"} + ], + "sea_layers": [ + {"height": -1, "block": "base:water"} + ] + }, + "plains": { + "parameters": [ + {"weight": 0.6, "value": 0.5}, + {"weight": 0.6, "value": 0.5} + ], + "layers": [ + {"below_sea_level": false, "height": 1, "block": "base:grass_block"}, + {"below_sea_level": false, "height": 5, "block": "base:dirt"}, + {"height": -1, "block": "base:stone"}, + {"height": 1, "block": "base:bazalt"} + ], + "sea_layers": [ + {"height": -1, "block": "base:water"} + ], + "plant_chance": 0.3, + "plants": [ + {"weight": 1, "block": "base:grass"}, + {"weight": 0.03, "block": "base:flower"} + ], + "structure_chance": 0.0001, + "structures": [ + {"name": "tree0", "weight": 1}, + {"name": "tree1", "weight": 1} + ] + } +}