From 2a4fe39d5cc74edf8870e62d9be8921d6dc43bec Mon Sep 17 00:00:00 2001 From: kno10 Date: Sat, 3 Aug 2024 20:28:23 +0200 Subject: [PATCH] prioritize map decorations to make the generations more deterministic --- mods/MAPGEN/mcl_biomes/init.lua | 539 +++++++++++----------- mods/MAPGEN/mcl_mapgen_core/api.lua | 51 ++ mods/MAPGEN/mcl_mapgen_core/v6.lua | 8 + mods/MAPGEN/mcl_structures/api.lua | 2 +- mods/MAPGEN/mcl_terrain_features/init.lua | 8 +- 5 files changed, 342 insertions(+), 266 deletions(-) diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 9ac37eac5..edbc02cba 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -2185,7 +2185,7 @@ local function register_dimension_biomes() --[[ THE NETHER ]] -- the following decoration is a hack to cover exposed bedrock in netherrack - be careful not to put any ceiling decorations in a way that would apply to this (they would get generated regardless of biome) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:bedrock"}, sidelen = 16, @@ -2198,7 +2198,7 @@ local function register_dimension_biomes() flags = "all_ceilings", param2 = 0, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:bedrock"}, sidelen = 16, @@ -2234,7 +2234,7 @@ local function register_dimension_biomes() _mcl_fogcolor = "#330808" }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_nether:netherrack", "mcl_nether:glowstone", "mcl_blackstone:nether_gold", "mcl_nether:quartz_ore", "mcl_core:gravel", "mcl_nether:soul_sand", "mcl_nether:glowstone", "mcl_nether:magma"}, sidelen = 16, @@ -2267,7 +2267,7 @@ local function register_dimension_biomes() _mcl_skycolor = nether_skycolor, _mcl_fogcolor = "#1B4745" }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_nether:netherrack", "mcl_nether:glowstone", "mcl_nether:magma"}, sidelen = 16, @@ -2293,7 +2293,7 @@ local function register_dimension_biomes() noise_params = { offset = 0, scale = 1, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 12345, octaves = 3, persist = 0.6, @@ -2321,7 +2321,7 @@ local function register_dimension_biomes() _mcl_skycolor = nether_skycolor, _mcl_fogcolor = "#330303" }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_nether:netherrack", "mcl_nether:glowstone", "mcl_blackstone:nether_gold", "mcl_nether:quartz_ore", "mcl_core:gravel", "mcl_nether:soul_sand", "mcl_nether:magma", "mcl_blackstone:blackstone"}, sidelen = 16, @@ -2353,7 +2353,7 @@ local function register_dimension_biomes() _mcl_skycolor = nether_skycolor, _mcl_fogcolor = "#1A051A" }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_nether:netherrack", "mcl_nether:glowstone", "mcl_blackstone:nether_gold", "mcl_nether:quartz_ore", "mcl_core:gravel", "mcl_nether:soul_sand", "mcl_nether:magma", "mcl_blackstone:blackstone"}, sidelen = 16, @@ -2386,7 +2386,7 @@ local function register_dimension_biomes() _mcl_fogcolor = "#685F70" }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_nether:netherrack", "mcl_nether:glowstone", "mcl_blackstone:nether_gold", "mcl_nether:quartz_ore", "mcl_core:gravel", "mcl_nether:soul_sand", "mcl_blackstone:blackstone", "mcl_nether:magma"}, sidelen = 16, @@ -2412,7 +2412,7 @@ local function register_dimension_biomes() noise_params = { offset = 0, scale = 1, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 12345, octaves = 3, persist = 0.6, @@ -2535,8 +2535,8 @@ local function register_dimension_biomes() heat_point = 500, humidity_point = 500, vertical_blend = 16, - max_pos = {x = 1250, y = mcl_vars.mg_end_min + 512, z = 1250}, - min_pos = {x = -1250, y = mcl_vars.mg_end_min, z = -1250}, + max_pos = vector.new(1250, mcl_vars.mg_end_min + 512, 1250), + min_pos = vector.new(-1250, mcl_vars.mg_end_min, -1250), _mcl_biome_type = "medium", _mcl_grass_palette_index = 0, _mcl_foliage_palette_index = 0, @@ -2553,8 +2553,8 @@ local function register_dimension_biomes() node_water = "air", node_river_water = "air", node_cave_liquid = "air", - max_pos = {x = 650, y = mcl_vars.mg_end_min + 512, z = 650}, - min_pos = {x = -650, y = mcl_vars.mg_end_min, z = -650}, + max_pos = vector.new(650, mcl_vars.mg_end_min + 512, 650), + min_pos = vector.new(-650, mcl_vars.mg_end_min, -650), heat_point = 50, humidity_point = 50, vertical_blend = 16, @@ -2680,7 +2680,7 @@ local function register_biomelike_ores() y_min = mcl_vars.mg_overworld_min, y_max = mcl_vars.mg_overworld_max, noise_threshold = 0.2, - noise_params = {offset = 0, scale = 15, spread = {x = 130, y = 130, z = 130}, seed = 24, octaves = 3, persist = 0.70}, + noise_params = {offset = 0, scale = 15, spread = vector.new(130, 130, 130), seed = 24, octaves = 3, persist = 0.70}, biomes = {"MegaTaiga"}, }) @@ -2693,7 +2693,7 @@ local function register_biomelike_ores() y_min = mcl_vars.mg_overworld_min, y_max = mcl_vars.mg_overworld_max, noise_threshold = 0.0, - noise_params = {offset = 0, scale = 15, spread = {x = 250, y = 250, z = 250}, seed = 24, octaves = 3, persist = 0.70}, + noise_params = {offset = 0, scale = 15, spread = vector.new(250, 250, 250), seed = 24, octaves = 3, persist = 0.70}, biomes = {"MesaPlateauF_grasstop"}, }) minetest.register_ore({ @@ -2708,7 +2708,7 @@ local function register_biomelike_ores() noise_params = { offset = 0, scale = 1, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 12345, octaves = 3, persist = 0.6, @@ -2726,7 +2726,7 @@ local function register_biomelike_ores() y_min = mcl_vars.mg_overworld_min, y_max = mcl_vars.mg_overworld_max, noise_threshold = -2.5, - noise_params = {offset = 1, scale = 15, spread = {x = 250, y = 250, z = 250}, seed = 24, octaves = 3, persist = 0.80}, + noise_params = {offset = 1, scale = 15, spread = vector.new(250, 250, 250), seed = 24, octaves = 3, persist = 0.80}, biomes = {"MesaPlateauFM_grasstop"}, }) minetest.register_ore({ @@ -2741,7 +2741,7 @@ local function register_biomelike_ores() noise_params = { offset = 0, scale = 1, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 12345, octaves = 3, persist = 0.6, @@ -2762,7 +2762,7 @@ local function register_biomelike_ores() noise_params = { offset = 0, scale = 1, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 12345, octaves = 3, persist = 0.6, @@ -2782,7 +2782,7 @@ local function register_biomelike_ores() noise_params = { offset = 0, scale = 1, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 12345, octaves = 3, persist = 0.6, @@ -2802,7 +2802,7 @@ local function register_biomelike_ores() y_min = mcl_vars.mg_overworld_min, y_max = mcl_vars.mg_overworld_max, noise_threshold = 0.1, - noise_params = {offset = 0, scale = 15, spread = {x = 130, y = 130, z = 130}, seed = 95, octaves = 3, persist = 0.70}, + noise_params = {offset = 0, scale = 15, spread = vector.new(130, 130, 130), seed = 95, octaves = 3, persist = 0.70}, biomes = {"MesaPlateauFM"}, }) minetest.register_ore({ @@ -2816,7 +2816,7 @@ local function register_biomelike_ores() noise_params = { offset = 0, scale = 1, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 12345, octaves = 3, persist = 0.6, @@ -2838,7 +2838,7 @@ local function register_biomelike_ores() y_min = mcl_vars.mg_overworld_min, y_max = mcl_vars.mg_overworld_max, noise_threshold = 0.2, - noise_params = {offset = 0, scale = 5, spread = {x = 250, y = 250, z = 250}, seed = 64, octaves = 3, persist = 0.60}, + noise_params = {offset = 0, scale = 5, spread = vector.new(250, 250, 250), seed = 64, octaves = 3, persist = 0.60}, biomes = {"ExtremeHillsM"}, }) -- For a transition from stone to hardened clay in mesa biomes that is not perfectly flat @@ -2846,7 +2846,7 @@ local function register_biomelike_ores() ore_type = "stratum", ore = "mcl_core:stone", wherein = {"group:hardened_clay"}, - noise_params = {offset = -6, scale = 2, spread = {x = 25, y = 25, z = 25}, octaves = 1, persist = 0.60}, + noise_params = {offset = -6, scale = 2, spread = vector.new(25, 25, 25), octaves = 1, persist = 0.60}, stratum_thickness = 8, biomes = { "Mesa_sandlevel", "Mesa_ocean", @@ -2900,7 +2900,7 @@ local function register_biomelike_ores() noise_params = { offset = y_min + (y_max - y_min) / 2, scale = 0, - spread = {x = 50, y = 50, z = 50}, + spread = vector.new(50, 50, 50), seed = seed + 4, octaves = 1, persist = 1.0 @@ -2908,7 +2908,7 @@ local function register_biomelike_ores() np_stratum_thickness = { offset = 1.28, scale = 1, - spread = {x = 18, y = 18, z = 18}, + spread = vector.new(18, 18, 18), seed = seed + 4, octaves = 3, persist = 0.8, @@ -2925,7 +2925,7 @@ local function register_biomelike_ores() noise_params = { offset = y_min + (y_max - y_min) / 2, scale = 0, - spread = {x = 50, y = 50, z = 50}, + spread = vector.new(50, 50, 50), seed = seed + 4, octaves = 1, persist = 1.0 @@ -2933,7 +2933,7 @@ local function register_biomelike_ores() np_stratum_thickness = { offset = 0.1, scale = 1, - spread = {x = 28, y = 28, z = 28}, + spread = vector.new(28, 28, 28), seed = seed + 4, octaves = 2, persist = 0.6, @@ -3040,7 +3040,7 @@ local function register_dimension_ores() noise_params = { offset = 0.5, scale = 0.1, - spread = {x = 5, y = 5, z = 5}, + spread = vector.new(5, 5, 5), seed = 2316, octaves = 1, persist = 0.0 @@ -3060,7 +3060,7 @@ local function register_dimension_ores() noise_params = { offset = 0, scale = 1, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 12345, octaves = 3, persist = 0.6, @@ -3080,7 +3080,7 @@ local function register_dimension_ores() noise_params = { offset = 0, scale = 1, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 12345, octaves = 3, persist = 0.6, @@ -3102,7 +3102,7 @@ local function register_dimension_ores() noise_params = { offset = 0.5, scale = 0.1, - spread = {x = 5, y = 5, z = 5}, + spread = vector.new(5, 5, 5), seed = 17676, octaves = 1, persist = 0.0 @@ -3124,7 +3124,7 @@ local function register_dimension_ores() noise_params = { offset = 0.0, scale = 0.5, - spread = {x = 20, y = 20, z = 20}, + spread = vector.new(20, 20, 20), seed = 766, octaves = 3, persist = 0.6, @@ -3243,7 +3243,7 @@ local function register_dimension_ores() noise_params = { offset = mcl_vars.mg_end_min + 70, scale = -1, - spread = {x = 84, y = 84, z = 84}, + spread = vector.new(84, 84, 84), seed = 145, octaves = 3, persist = 0.6, @@ -3254,7 +3254,7 @@ local function register_dimension_ores() np_stratum_thickness = { offset = 0, scale = 15, - spread = {x = 84, y = 84, z = 84}, + spread = vector.new(84, 84, 84), seed = 145, octaves = 3, persist = 0.6, @@ -3275,7 +3275,7 @@ local function register_dimension_ores() noise_params = { offset = mcl_vars.mg_end_min + 70, scale = -1, - spread = {x = 126, y = 126, z = 126}, + spread = vector.new(126, 126, 126), seed = mg_seed + 9999, octaves = 3, persist = 0.5, @@ -3284,7 +3284,7 @@ local function register_dimension_ores() np_stratum_thickness = { offset = -2, scale = 10, - spread = {x = 126, y = 126, z = 126}, + spread = vector.new(126, 126, 126), seed = mg_seed + 9999, octaves = 3, persist = 0.5, @@ -3303,7 +3303,7 @@ local function register_dimension_ores() noise_params = { offset = mcl_vars.mg_end_min + 72, scale = -3, - spread = {x = 84, y = 84, z = 84}, + spread = vector.new(84, 84, 84), seed = mg_seed + 999, octaves = 4, persist = 0.8, @@ -3312,7 +3312,7 @@ local function register_dimension_ores() np_stratum_thickness = { offset = -4, scale = 10, - spread = {x = 84, y = 84, z = 84}, + spread = vector.new(84, 84, 84), seed = mg_seed + 999, octaves = 4, persist = 0.8, @@ -3330,7 +3330,7 @@ local function register_dimension_ores() noise_params = { offset = mcl_vars.mg_end_min + 70, scale = -2, - spread = {x = 84, y = 84, z = 84}, + spread = vector.new(84, 84, 84), seed = mg_seed + 99, octaves = 4, persist = 0.85, @@ -3339,7 +3339,7 @@ local function register_dimension_ores() np_stratum_thickness = { offset = -3, scale = 5, - spread = {x = 63, y = 63, z = 63}, + spread = vector.new(63, 63, 63), seed = mg_seed + 50, octaves = 4, persist = 0.85, @@ -3367,15 +3367,16 @@ local function register_grass_decoration(grasstype, offset, scale, biomes) local noise = { offset = offset, scale = scale, - spread = {x = 200, y = 200, z = 200}, + spread = vector.new(200, 200, 200), seed = seed, octaves = 3, persist = 0.6 } for b = 1, #biomes do local param2 = minetest.registered_biomes[biomes[b]]._mcl_grass_palette_index - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", + priority = 1500, place_on = place_on, sidelen = 16, noise_params = noise, @@ -3406,15 +3407,16 @@ local function register_seagrass_decoration(grasstype, offset, scale, biomes) local noise = { offset = offset, scale = scale, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = seed, octaves = 3, persist = 0.6, } for s = 1, #surfaces do - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", + priority = 1500, place_on = {surfaces[s]}, sidelen = 16, noise_params = noise, @@ -3463,14 +3465,14 @@ local function register_coral_decos(ck) local noise = { offset = -0.0085, scale = 0.002, - spread = {x = 25, y = 120, z = 25}, + spread = vector.new(25, 120, 25), seed = 235, octaves = 5, persist = 1.8, lacunarity = 3.5, flags = "absvalue" } - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:sand", "mcl_core:gravel", "mcl_mud:mud"}, sidelen = 80, @@ -3482,7 +3484,7 @@ local function register_coral_decos(ck) rotation = "random", flags = "all_floors,force_placement", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:sand", "mcl_core:gravel", "mcl_mud:mud"}, noise_params = noise, @@ -3495,7 +3497,7 @@ local function register_coral_decos(ck) flags = "all_floors,force_placement", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_ocean:" .. c .. "_coral_block"}, sidelen = 16, @@ -3508,7 +3510,7 @@ local function register_coral_decos(ck) height = 1, height_max = 1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_ocean:horn_coral_block"}, sidelen = 16, @@ -3528,14 +3530,14 @@ local function register_decorations() for k, _ in pairs(corals) do register_coral_decos(k) end - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:sand", "mcl_core:gravel", "mcl_mud:mud"}, sidelen = 16, noise_params = { offset = -0.0085, scale = 0.002, - spread = {x = 25, y = 120, z = 25}, + spread = vector.new(25, 120, 25), seed = 235, octaves = 5, persist = 1.8, @@ -3552,7 +3554,7 @@ local function register_decorations() place_offset_y = -1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_ocean:dead_brain_coral_block"}, sidelen = 16, @@ -3566,7 +3568,7 @@ local function register_decorations() height_max = 1, place_offset_y = -1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_ocean:dead_brain_coral_block"}, sidelen = 16, @@ -3580,7 +3582,7 @@ local function register_decorations() height_max = 1, place_offset_y = -1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_ocean:dead_brain_coral_block"}, sidelen = 16, @@ -3594,7 +3596,7 @@ local function register_decorations() height_max = 1, place_offset_y = -1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_ocean:dead_brain_coral_block"}, sidelen = 16, @@ -3609,7 +3611,7 @@ local function register_decorations() place_offset_y = -1, }) --rare CORAl - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:sand", "mcl_core:gravel"}, fill_ratio = 0.0001, @@ -3622,14 +3624,14 @@ local function register_decorations() flags = "place_center_x,place_center_z, force_placement", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:dirt_with_grass", "mcl_core:podzol"}, sidelen = 16, noise_params = { offset = 0, scale = 0.012, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 354, octaves = 1, persist = 0.5, @@ -3643,14 +3645,14 @@ local function register_decorations() }) -- Large ice spike - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:snowblock", "mcl_core:snow", "group:grass_block_snow"}, sidelen = 80, noise_params = { offset = 0.00040, scale = 0.001, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 1133, octaves = 4, persist = 0.67, @@ -3664,14 +3666,14 @@ local function register_decorations() }) -- Small ice spike - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:snowblock", "mcl_core:snow", "group:grass_block_snow"}, sidelen = 80, noise_params = { offset = 0.005, scale = 0.001, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 1133, octaves = 4, persist = 0.67, @@ -3687,14 +3689,14 @@ local function register_decorations() -- Oak -- Large oaks for i = 1, 4 do - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, noise_params = { offset = 0.000545, scale = 0.0011, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 3 + 5 * i, octaves = 3, persist = 0.66 @@ -3707,14 +3709,14 @@ local function register_decorations() rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block", "mcl_core:dirt", }, sidelen = 80, noise_params = { offset = -0.0007, scale = 0.001, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 3, octaves = 3, persist = 0.6 @@ -3728,14 +3730,14 @@ local function register_decorations() }) end -- Small “classic” oak (many biomes) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.025, scale = 0.0022, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.66 @@ -3747,14 +3749,14 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.01, scale = 0.0022, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.66 @@ -3766,14 +3768,14 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block", "mcl_core:dirt", }, sidelen = 16, noise_params = { offset = 0.0, scale = 0.002, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.7 @@ -3786,14 +3788,14 @@ local function register_decorations() rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.006, scale = 0.002, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.7 @@ -3805,14 +3807,14 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.015, scale = 0.002, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.7 @@ -3824,14 +3826,14 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.008, scale = 0.002, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.7 @@ -3844,14 +3846,14 @@ local function register_decorations() rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block", "mcl_core:dirt", }, sidelen = 16, noise_params = { offset = 0.0, scale = 0.0002, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.7 @@ -3863,7 +3865,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -3875,7 +3877,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -3887,14 +3889,14 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 16, --[[noise_params = { offset = 0.01, scale = 0.00001, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.33 @@ -3907,15 +3909,16 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", spawn_by = "group:flower", + priority = 1550, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 16, --[[noise_params = { offset = 0.01, scale = 0.00001, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.33 @@ -3928,17 +3931,18 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", spawn_by = "group:flower", + priority = 1550, }) -- Rare balloon oak - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.002083, scale = 0.0022, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 3, octaves = 3, persist = 0.6, @@ -3952,14 +3956,14 @@ local function register_decorations() }) -- Swamp oak - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, noise_params = { offset = 0.0055, scale = 0.0011, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 5005, octaves = 5, persist = 0.6, @@ -3972,7 +3976,7 @@ local function register_decorations() rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ name = "mcl_biomes:mangrove_tree_1", deco_type = "schematic", place_on = {"mcl_mud:mud"}, @@ -3985,7 +3989,7 @@ local function register_decorations() flags = "place_center_x, place_center_z, force_placement", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ name = "mcl_biomes:mangrove_tree_2", deco_type = "schematic", place_on = {"mcl_mud:mud"}, @@ -3998,7 +4002,7 @@ local function register_decorations() flags = "place_center_x, place_center_z, force_placement", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ name = "mcl_biomes:mangrove_tree_3", deco_type = "schematic", place_on = {"mcl_mud:mud"}, @@ -4011,7 +4015,7 @@ local function register_decorations() flags = "place_center_x, place_center_z, force_placement", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ name = "mcl_biomes:mangrove_tree_4", deco_type = "schematic", place_on = {"mcl_mud:mud"}, @@ -4024,7 +4028,7 @@ local function register_decorations() flags = "place_center_x, place_center_z, force_placement", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ name = "mcl_biomes:mangrove_tree_5", deco_type = "schematic", place_on = {"mcl_mud:mud"}, @@ -4037,7 +4041,7 @@ local function register_decorations() flags = "place_center_x, place_center_z, force_placement", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ name = "mcl_biomes:mangrove_bee_nest", deco_type = "schematic", place_on = {"mcl_mud:mud"}, @@ -4045,7 +4049,7 @@ local function register_decorations() --[[noise_params = { offset = 0.01, scale = 0.00001, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.33 @@ -4058,8 +4062,9 @@ local function register_decorations() flags = "place_center_x, place_center_z, force_placement", rotation = "random", spawn_by = "group:flower", + priority = 1550, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_mud:mud"}, sidelen = 80, @@ -4071,7 +4076,7 @@ local function register_decorations() flags = "place_center_x, place_center_z, force_placement", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_mangrove:mangrove_roots"}, spawn_by = {"group:water"}, @@ -4084,7 +4089,7 @@ local function register_decorations() decoration = "mcl_mangrove:water_logged_roots", flags = "place_center_x, place_center_z, force_placement, all_ceilings", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_mud:mud"}, sidelen = 80, @@ -4094,7 +4099,7 @@ local function register_decorations() decoration = "mcl_mangrove:mangrove_mud_roots", flags = "place_center_x, place_center_z, force_placement", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_mud:mud"}, sidelen = 80, @@ -4103,7 +4108,7 @@ local function register_decorations() decoration = "mcl_core:deadbush", flags = "place_center_x, place_center_z", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:water_source"}, sidelen = 80, @@ -4117,7 +4122,7 @@ local function register_decorations() -- Huge jungle tree (4 variants) for i = 1, 4 do - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4129,7 +4134,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4144,7 +4149,7 @@ local function register_decorations() end -- Common jungle tree - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4156,7 +4161,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4168,7 +4173,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4180,7 +4185,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4192,7 +4197,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4204,7 +4209,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4217,7 +4222,7 @@ local function register_decorations() rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4234,14 +4239,14 @@ local function register_decorations() if not y then y = 1 end - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block", "mcl_core:dirt", "mcl_core:podzol"}, sidelen = 16, noise_params = { offset = offset, scale = 0.0006, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = seed, octaves = 3, persist = 0.66 @@ -4288,14 +4293,14 @@ local function register_decorations() -- Small lollipop spruce - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block", "mcl_core:podzol"}, sidelen = 16, noise_params = { offset = 0.004, scale = 0.0022, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2500, octaves = 3, persist = 0.66 @@ -4308,14 +4313,14 @@ local function register_decorations() }) -- Matchstick spruce: Very few leaves, tall trunk - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block", "mcl_core:podzol"}, sidelen = 80, noise_params = { offset = -0.025, scale = 0.025, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2566, octaves = 5, persist = 0.60, @@ -4328,14 +4333,14 @@ local function register_decorations() }) -- Rare spruce in Ice Plains - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block"}, sidelen = 16, noise_params = { offset = -0.00075, scale = -0.0015, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 11, octaves = 3, persist = 0.7 @@ -4349,7 +4354,7 @@ local function register_decorations() -- Acacia (many variants) for a = 1, 7 do - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt", "mcl_core:coarse_dirt"}, sidelen = 16, @@ -4364,14 +4369,14 @@ local function register_decorations() end -- Birch - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow"}, sidelen = 16, noise_params = { offset = 0.03, scale = 0.0025, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 11, octaves = 3, persist = 0.66 @@ -4382,14 +4387,14 @@ local function register_decorations() schematic = mod_mcl_core .. "/schematics/mcl_core_birch.mts", flags = "place_center_x, place_center_z", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow"}, sidelen = 16, noise_params = { offset = 0.03, scale = 0.0025, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 11, octaves = 3, persist = 0.66 @@ -4401,14 +4406,14 @@ local function register_decorations() flags = "place_center_x, place_center_z", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.000333, scale = -0.0015, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 11, octaves = 3, persist = 0.66 @@ -4419,14 +4424,14 @@ local function register_decorations() schematic = mod_mcl_core .. "/schematics/mcl_core_birch.mts", flags = "place_center_x, place_center_z", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 16, --[[noise_params = { offset = 0.01, scale = 0.00001, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2, octaves = 3, persist = 0.33 @@ -4439,17 +4444,18 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "random", spawn_by = "group:flower", + priority = 1550, }) -- Dark Oak - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow"}, sidelen = 16, noise_params = { offset = 0.05, scale = 0.0015, - spread = {x = 125, y = 125, z = 125}, + spread = vector.new(125, 125, 125), seed = 223, octaves = 3, persist = 0.66 @@ -4470,7 +4476,7 @@ local function register_decorations() local ratio_mushroom_mycelium_giant = ratio_mushroom_mycelium * (1 / 12) -- Huge Brown Mushroom - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4482,7 +4488,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "0", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4495,7 +4501,7 @@ local function register_decorations() rotation = "0", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:mycelium"}, sidelen = 80, @@ -4507,7 +4513,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "0", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:mycelium"}, sidelen = 80, @@ -4521,7 +4527,7 @@ local function register_decorations() }) -- Huge Red Mushroom - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4533,7 +4539,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "0", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, @@ -4546,7 +4552,7 @@ local function register_decorations() rotation = "0", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:mycelium"}, sidelen = 80, @@ -4558,7 +4564,7 @@ local function register_decorations() flags = "place_center_x, place_center_z", rotation = "0", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:mycelium"}, sidelen = 80, @@ -4572,7 +4578,7 @@ local function register_decorations() }) --Snow on snowy dirt - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:dirt_with_grass_snow"}, sidelen = 80, @@ -4584,7 +4590,7 @@ local function register_decorations() }) --Mushrooms in caves - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:material_stone"}, sidelen = 80, @@ -4595,7 +4601,7 @@ local function register_decorations() y_max = mcl_vars.mg_overworld_max, decoration = "mcl_mushrooms:mushroom_red", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:material_stone"}, sidelen = 80, @@ -4607,14 +4613,14 @@ local function register_decorations() }) -- Mossy cobblestone boulder (3×3) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:podzol", "mcl_core:dirt", "mcl_core:coarse_dirt"}, sidelen = 80, noise_params = { offset = 0.00015, scale = 0.001, - spread = {x = 300, y = 300, z = 300}, + spread = vector.new(300, 300, 300), seed = 775703, octaves = 4, persist = 0.63, @@ -4628,14 +4634,14 @@ local function register_decorations() }) -- Small mossy cobblestone boulder (2×2) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:podzol", "mcl_core:dirt", "mcl_core:coarse_dirt"}, sidelen = 80, noise_params = { offset = 0.001, scale = 0.001, - spread = {x = 300, y = 300, z = 300}, + spread = vector.new(300, 300, 300), seed = 775703, octaves = 4, persist = 0.63, @@ -4649,7 +4655,7 @@ local function register_decorations() }) -- Cacti - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:sand"}, sidelen = 16, @@ -4676,14 +4682,14 @@ local function register_decorations() }) -- Sugar canes - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:dirt", "mcl_core:coarse_dirt", "group:grass_block_no_snow", "group:sand", "mcl_core:podzol", "mcl_core:reeds"}, sidelen = 16, noise_params = { offset = -0.3, scale = 0.7, - spread = {x = 200, y = 200, z = 200}, + spread = vector.new(200, 200, 200), seed = 2, octaves = 3, persist = 0.7 @@ -4696,14 +4702,14 @@ local function register_decorations() spawn_by = {"mcl_core:water_source", "group:frosted_ice"}, num_spawn_by = 1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:dirt", "mcl_core:coarse_dirt", "group:grass_block_no_snow", "group:sand", "mcl_core:podzol", "mcl_core:reeds"}, sidelen = 16, noise_params = { offset = 0.0, scale = 0.5, - spread = {x = 200, y = 200, z = 200}, + spread = vector.new(200, 200, 200), seed = 2, octaves = 3, persist = 0.7, @@ -4723,10 +4729,11 @@ local function register_decorations() for b = 1, #biomes do local param2 = minetest.registered_biomes[biomes[b]]._mcl_grass_palette_index - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", + priority = 1500, schematic = { - size = {x = 1, y = 3, z = 1}, + size = vector.new(1, 3, 1), data = { {name = "air", prob = 0}, {name = "mcl_flowers:double_grass", param1 = 255, param2 = param2}, @@ -4738,7 +4745,7 @@ local function register_decorations() noise_params = { offset = offset, scale = scale, - spread = {x = 200, y = 200, z = 200}, + spread = vector.new(200, 200, 200), seed = 420, octaves = 3, persist = 0.6, @@ -4758,10 +4765,11 @@ local function register_decorations() local function register_double_fern(offset, scale, biomes) for b = 1, #biomes do local param2 = minetest.registered_biomes[biomes[b]]._mcl_grass_palette_index - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", + priority = 1500, schematic = { - size = {x = 1, y = 3, z = 1}, + size = vector.new(1, 3, 1), data = { {name = "air", prob = 0}, {name = "mcl_flowers:double_fern", param1 = 255, param2 = param2}, @@ -4773,7 +4781,7 @@ local function register_decorations() noise_params = { offset = offset, scale = scale, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 333, octaves = 2, persist = 0.66, @@ -4806,10 +4814,10 @@ local function register_decorations() b = {"FlowerForest"} end - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", schematic = { - size = {x = 1, y = 3, z = 1}, + size = vector.new(1, 3, 1), data = { {name = "air", prob = 0}, {name = "mcl_flowers:" .. name, param1 = 255, }, @@ -4822,7 +4830,7 @@ local function register_decorations() noise_params = { offset = o, scale = 0.01, - spread = {x = 300, y = 300, z = 300}, + spread = vector.new(300, 300, 300), seed = seed, octaves = 5, persist = 0.62, @@ -4842,14 +4850,14 @@ local function register_decorations() -- Jungle bush - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, noise_params = { offset = 0.0196, scale = 0.015, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2930, octaves = 4, persist = 0.6, @@ -4860,14 +4868,14 @@ local function register_decorations() schematic = mod_mcl_core .. "/schematics/mcl_core_jungle_bush_oak_leaves.mts", flags = "place_center_x, place_center_z", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, noise_params = { offset = 0.0196, scale = 0.005, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2930, octaves = 4, persist = 0.6, @@ -4878,14 +4886,14 @@ local function register_decorations() schematic = mod_mcl_core .. "/schematics/mcl_core_jungle_bush_oak_leaves_2.mts", flags = "place_center_x, place_center_z", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, noise_params = { offset = 0.05, scale = 0.025, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2930, octaves = 4, persist = 0.6, @@ -4896,14 +4904,14 @@ local function register_decorations() schematic = mod_mcl_core .. "/schematics/mcl_core_jungle_bush_oak_leaves.mts", flags = "place_center_x, place_center_z", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, noise_params = { offset = 0.0085, scale = 0.025, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 2930, octaves = 4, persist = 0.6, @@ -4916,7 +4924,7 @@ local function register_decorations() }) -- Bamboo - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow", "mcl_core:dirt", }, sidelen = 80, @@ -4931,7 +4939,7 @@ local function register_decorations() rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow", "mcl_core:dirt", "mcl_core:podzol"}, sidelen = 80, @@ -4946,14 +4954,15 @@ local function register_decorations() rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", + priority = 1500, place_on = {"group:grass_block_no_snow"}, sidelen = 16, noise_params = { offset = 0, scale = 0.012, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 354, octaves = 1, persist = 0.5, @@ -4985,10 +4994,10 @@ local function register_decorations() local y = 1 - d table.insert(lily_schem, 1, {name = "air", prob = 0}) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", schematic = { - size = {x = 1, y = height, z = 1}, + size = vector.new(1, height, 1), data = lily_schem, }, place_on = "mcl_core:dirt", @@ -4996,7 +5005,7 @@ local function register_decorations() noise_params = { offset = 0, scale = 0.3, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 503, octaves = 6, persist = 0.7, @@ -5009,14 +5018,14 @@ local function register_decorations() end -- Melon - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow"}, sidelen = 16, noise_params = { offset = -0.01, scale = 0.006, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 333, octaves = 3, persist = 0.6 @@ -5026,14 +5035,14 @@ local function register_decorations() decoration = "mcl_farming:melon", biomes = {"Jungle", "BambooJungle"}, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow"}, sidelen = 16, noise_params = { offset = 0.0, scale = 0.006, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 333, octaves = 3, persist = 0.6 @@ -5043,14 +5052,14 @@ local function register_decorations() decoration = "mcl_farming:melon", biomes = {"JungleM", "BambooJungleM"}, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow"}, sidelen = 16, noise_params = { offset = -0.005, scale = 0.006, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 333, octaves = 3, persist = 0.6 @@ -5062,14 +5071,14 @@ local function register_decorations() }) -- Lots of melons in Jungle Edge M - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow"}, sidelen = 80, noise_params = { offset = 0.013, scale = 0.006, - spread = {x = 125, y = 125, z = 125}, + spread = vector.new(125, 125, 125), seed = 333, octaves = 3, persist = 0.6 @@ -5081,7 +5090,7 @@ local function register_decorations() }) -- Pumpkin - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", decoration = "mcl_farming:pumpkin", param2 = 0, @@ -5091,7 +5100,7 @@ local function register_decorations() noise_params = { offset = -0.016, scale = 0.01332, - spread = {x = 125, y = 125, z = 125}, + spread = vector.new(125, 125, 125), seed = 666, octaves = 6, persist = 0.666 @@ -5157,7 +5166,7 @@ local function register_decorations() local b_sponge = {"Plains_deep_ocean", "SunflowerPlains_deep_ocean", "Forest_deep_ocean", "FlowerForest_deep_ocean", "BirchForest_deep_ocean", "BirchForestM_deep_ocean", "RoofedForest_deep_ocean", "Jungle_deep_ocean", "JungleM_deep_ocean", "JungleEdge_deep_ocean", "JungleEdgeM_deep_ocean", "MushroomIsland_deep_ocean", "Desert_deep_ocean", "Savanna_deep_ocean", "SavannaM_deep_ocean", "Mesa_deep_ocean", "MesaBryce_deep_ocean", "MesaPlateauF_deep_ocean", "MesaPlateauFM_deep_ocean"} -- Wet Sponge -- TODO: Remove this when we got ocean monuments - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", decoration = "mcl_sponges:sponge_wet", biomes = b_sponge, @@ -5168,7 +5177,7 @@ local function register_decorations() noise_params = { offset = 0.00495, scale = 0.006, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = 999, octaves = 3, persist = 0.666 @@ -5179,14 +5188,15 @@ local function register_decorations() }) -- Place tall grass on snow in Ice Plains and Extreme Hills+ - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", + priority = 1500, place_on = {"group:grass_block"}, sidelen = 16, noise_params = { offset = -0.08, scale = 0.09, - spread = {x = 15, y = 15, z = 15}, + spread = vector.new(15, 15, 15), seed = 420, octaves = 3, persist = 0.6, @@ -5195,21 +5205,22 @@ local function register_decorations() y_min = 1, y_max = mcl_vars.mg_overworld_max, schematic = { - size = {x = 1, y = 2, z = 1}, + size = vector.new(1, 2, 1), data = { {name = "mcl_core:dirt_with_grass", force_place = true, }, {name = "mcl_flowers:tallgrass", param2 = minetest.registered_biomes["IcePlains"]._mcl_grass_palette_index}, }, }, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", + priority = 1500, place_on = {"group:grass_block"}, sidelen = 16, noise_params = { offset = 0.0, scale = 0.09, - spread = {x = 15, y = 15, z = 15}, + spread = vector.new(15, 15, 15), seed = 420, octaves = 3, persist = 0.6, @@ -5218,7 +5229,7 @@ local function register_decorations() y_min = 1, y_max = mcl_vars.mg_overworld_max, schematic = { - size = {x = 1, y = 2, z = 1}, + size = vector.new(1, 2, 1), data = { {name = "mcl_core:dirt_with_grass", force_place = true, }, {name = "mcl_flowers:tallgrass", param2 = minetest.registered_biomes["ExtremeHills+_snowtop"]._mcl_grass_palette_index}, @@ -5228,14 +5239,15 @@ local function register_decorations() -- Dead bushes - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", + priority = 1500, place_on = {"mcl_core:podzol", "mcl_core:dirt", "mcl_core:dirt_with_grass", "mcl_core:coarse_dirt", "group:hardened_clay"}, sidelen = 16, noise_params = { offset = 0.01, scale = 0.003, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 1972, octaves = 3, persist = 0.6 @@ -5246,14 +5258,15 @@ local function register_decorations() decoration = "mcl_core:deadbush", height = 1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", + priority = 1500, place_on = {"group:sand", "group:hardened_clay"}, sidelen = 16, noise_params = { offset = 0.01, scale = 0.006, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 1972, octaves = 3, persist = 0.6 @@ -5264,14 +5277,15 @@ local function register_decorations() decoration = "mcl_core:deadbush", height = 1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", + priority = 1500, place_on = {"group:sand", "mcl_core:podzol", "mcl_core:dirt", "mcl_core:dirt_with_grass", "mcl_core:coarse_dirt", "group:hardened_clay"}, sidelen = 16, noise_params = { offset = 0.01, scale = 0.06, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 1972, octaves = 3, persist = 0.6 @@ -5282,14 +5296,15 @@ local function register_decorations() decoration = "mcl_core:deadbush", height = 1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", + priority = 1500, place_on = {"group:sand", "mcl_core:dirt", "mcl_core:dirt_with_grass", "mcl_core:coarse_dirt"}, sidelen = 16, noise_params = { offset = 0.01, scale = 0.06, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 1972, octaves = 3, persist = 0.6 @@ -5300,14 +5315,15 @@ local function register_decorations() decoration = "mcl_core:deadbush", height = 1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", + priority = 1500, place_on = {"group:sand"}, sidelen = 16, noise_params = { offset = 0.01, scale = 0.06, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 1972, octaves = 3, persist = 0.6 @@ -5318,14 +5334,15 @@ local function register_decorations() decoration = "mcl_core:deadbush", height = 1, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", + priority = 1500, place_on = {"group:hardened_clay"}, sidelen = 16, noise_params = { offset = 0.01, scale = 0.06, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 1972, octaves = 3, persist = 0.6 @@ -5338,7 +5355,7 @@ local function register_decorations() }) -- Mushrooms in mushroom biome - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:mycelium"}, sidelen = 80, @@ -5349,7 +5366,7 @@ local function register_decorations() y_max = mcl_vars.mg_overworld_max, decoration = "mcl_mushrooms:mushroom_red", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:mycelium"}, sidelen = 80, @@ -5361,7 +5378,7 @@ local function register_decorations() }) -- Mushrooms in Taiga - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:podzol"}, sidelen = 80, @@ -5371,7 +5388,7 @@ local function register_decorations() y_max = mcl_vars.mg_overworld_max, decoration = "mcl_mushrooms:mushroom_red", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_core:podzol"}, sidelen = 80, @@ -5388,14 +5405,14 @@ local function register_decorations() local mseeds = {7133, 8244} for m = 1, #mushrooms do -- Mushrooms next to trees - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow", "mcl_core:dirt", "mcl_core:podzol", "mcl_core:mycelium", "mcl_core:stone", "mcl_core:andesite", "mcl_core:diorite", "mcl_core:granite"}, sidelen = 16, noise_params = { offset = 0, scale = 0.003, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = mseeds[m], octaves = 3, persist = 0.66, @@ -5405,17 +5422,18 @@ local function register_decorations() decoration = mushrooms[m], spawn_by = {"mcl_core:tree", "mcl_core:sprucetree", "mcl_core:darktree", "mcl_core:birchtree"}, num_spawn_by = 1, + priority = 1150, }) -- More mushrooms in Swampland - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow", "mcl_core:dirt", "mcl_core:podzol", "mcl_core:mycelium", "mcl_core:stone", "mcl_core:andesite", "mcl_core:diorite", "mcl_core:granite"}, sidelen = 16, noise_params = { offset = 0.05, scale = 0.003, - spread = {x = 250, y = 250, z = 250}, + spread = vector.new(250, 250, 250), seed = mseeds[m], octaves = 3, persist = 0.6, @@ -5426,6 +5444,7 @@ local function register_decorations() biomes = {"Swampland"}, spawn_by = {"mcl_core:tree", "mcl_core:sprucetree", "mcl_core:darktree", "mcl_core:birchtree"}, num_spawn_by = 1, + priority = 1150, }) end local function register_flower(name, biomes, seed, is_in_flower_forest, custom_rarity_mod) @@ -5433,14 +5452,14 @@ local function register_decorations() is_in_flower_forest = true end if biomes then - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.0008 + (custom_rarity_mod or 0), scale = 0.006, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = seed, octaves = 3, persist = 0.6 @@ -5452,14 +5471,14 @@ local function register_decorations() }) end if is_in_flower_forest then - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 80, noise_params = { offset = 0.0008 * 40, scale = 0.003, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = seed, octaves = 3, persist = 0.6, @@ -5499,7 +5518,7 @@ end local function register_dimension_decorations() --[[ NETHER ]] --NETHER WASTES (Nether) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_nether:netherrack", "mcl_nether:magma"}, sidelen = 16, @@ -5510,7 +5529,7 @@ local function register_dimension_decorations() flags = "all_floors", decoration = "mcl_fire:eternal_fire", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_nether:netherrack"}, sidelen = 16, @@ -5521,7 +5540,7 @@ local function register_dimension_decorations() flags = "all_floors", decoration = "mcl_mushrooms:mushroom_brown", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_nether:netherrack"}, sidelen = 16, @@ -5534,7 +5553,7 @@ local function register_dimension_decorations() }) -- WARPED FOREST - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_crimson:warped_nylium"}, sidelen = 16, @@ -5545,7 +5564,7 @@ local function register_dimension_decorations() flags = "all_floors", decoration = "mcl_crimson:warped_fungus", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", name = "mcl_biomes:warped_tree1", place_on = {"mcl_crimson:warped_nylium"}, @@ -5556,10 +5575,10 @@ local function register_dimension_decorations() y_max = mcl_vars.mg_nether_max - 15, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_crimson .. "/schematics/warped_fungus_1.mts", - size = {x = 5, y = 11, z = 5}, + size = vector.new(5, 11, 5), rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", name = "mcl_biomes:warped_tree2", place_on = {"mcl_crimson:warped_nylium"}, @@ -5570,10 +5589,10 @@ local function register_dimension_decorations() y_max = mcl_vars.mg_nether_max - 10, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_crimson .. "/schematics/warped_fungus_2.mts", - size = {x = 5, y = 6, z = 5}, + size = vector.new(5, 6, 5), rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", name = "mcl_biomes:warped_tree3", place_on = {"mcl_crimson:warped_nylium"}, @@ -5584,10 +5603,10 @@ local function register_dimension_decorations() y_max = mcl_vars.mg_nether_max - 14, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_crimson .. "/schematics/warped_fungus_3.mts", - size = {x = 5, y = 12, z = 5}, + size = vector.new(5, 12, 5), rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_crimson:warped_nylium", "mcl_crimson:twisting_vines"}, sidelen = 16, @@ -5599,7 +5618,7 @@ local function register_dimension_decorations() height_max = 8, decoration = "mcl_crimson:twisting_vines", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_crimson:warped_nylium"}, sidelen = 16, @@ -5610,7 +5629,7 @@ local function register_dimension_decorations() max_height = 5, decoration = "mcl_crimson:warped_roots", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_crimson:crimson_nylium"}, sidelen = 16, @@ -5621,7 +5640,7 @@ local function register_dimension_decorations() decoration = "mcl_crimson:nether_sprouts", }) -- CRIMSON FOREST - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_crimson:crimson_nylium"}, sidelen = 16, @@ -5632,7 +5651,7 @@ local function register_dimension_decorations() flags = "all_floors", decoration = "mcl_crimson:crimson_fungus", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", name = "mcl_biomes:crimson_tree", place_on = {"mcl_crimson:crimson_nylium"}, @@ -5643,10 +5662,10 @@ local function register_dimension_decorations() y_max = mcl_vars.mg_nether_max - 10, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_crimson .. "/schematics/crimson_fungus_1.mts", - size = {x = 5, y = 8, z = 5}, + size = vector.new(5, 8, 5), rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", name = "mcl_biomes:crimson_tree2", place_on = {"mcl_crimson:crimson_nylium"}, @@ -5657,10 +5676,10 @@ local function register_dimension_decorations() y_max = mcl_vars.mg_nether_max - 15, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_crimson .. "/schematics/crimson_fungus_2.mts", - size = {x = 5, y = 12, z = 5}, + size = vector.new(5, 12, 5), rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", name = "mcl_biomes:crimson_tree3", place_on = {"mcl_crimson:crimson_nylium"}, @@ -5671,10 +5690,10 @@ local function register_dimension_decorations() y_max = mcl_vars.mg_nether_max - 20, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_crimson .. "/schematics/crimson_fungus_3.mts", - size = {x = 7, y = 13, z = 7}, + size = vector.new(7, 13, 7), rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_crimson:warped_nylium", "mcl_crimson:weeping_vines", "mcl_nether:netherrack"}, sidelen = 16, @@ -5687,7 +5706,7 @@ local function register_dimension_decorations() height_max = 8, decoration = "mcl_crimson:weeping_vines", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_crimson:crimson_nylium"}, sidelen = 16, @@ -5700,7 +5719,7 @@ local function register_dimension_decorations() }) --SOULSAND VALLEY - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", place_on = {"mcl_blackstone:soul_soil", "mcl_nether:soul_sand"}, sidelen = 16, @@ -5711,7 +5730,7 @@ local function register_dimension_decorations() max_height = 5, decoration = "mcl_blackstone:soul_fire", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_blackstone:soul_soil", "mcl_nether:soulsand"}, sidelen = 16, @@ -5720,10 +5739,10 @@ local function register_dimension_decorations() y_min = mcl_vars.mg_lava_nether_max + 1, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_blackstone .. "/schematics/mcl_blackstone_nether_fossil_1.mts", - size = {x = 5, y = 8, z = 5}, + size = vector.new(5, 8, 5), rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_blackstone:soul_soil", "mcl_nether:soulsand"}, sidelen = 16, @@ -5732,10 +5751,10 @@ local function register_dimension_decorations() y_min = mcl_vars.mg_lava_nether_max + 1, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_blackstone .. "/schematics/mcl_blackstone_nether_fossil_2.mts", - size = {x = 5, y = 8, z = 5}, + size = vector.new(5, 8, 5), rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_blackstone:soul_soil", "mcl_nether:soulsand"}, sidelen = 16, @@ -5744,10 +5763,10 @@ local function register_dimension_decorations() y_min = mcl_vars.mg_lava_nether_max + 1, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_blackstone .. "/schematics/mcl_blackstone_nether_fossil_3.mts", - size = {x = 5, y = 8, z = 5}, + size = vector.new(5, 8, 5), rotation = "random", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "schematic", place_on = {"mcl_blackstone:soul_soil", "mcl_nether:soulsand"}, sidelen = 16, @@ -5756,11 +5775,11 @@ local function register_dimension_decorations() y_min = mcl_vars.mg_lava_nether_max + 1, flags = "all_floors, place_center_x, place_center_z", schematic = mod_mcl_blackstone .. "/schematics/mcl_blackstone_nether_fossil_4.mts", - size = {x = 5, y = 8, z = 5}, + size = vector.new(5, 8, 5), rotation = "random", }) --BASALT DELTA - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", decoration = "mcl_blackstone:basalt", place_on = {"mcl_blackstone:basalt", "mcl_nether:netherrack", "mcl_blackstone:blackstone"}, @@ -5769,7 +5788,7 @@ local function register_dimension_decorations() noise_params = { offset = -0.0085, scale = 0.002, - spread = {x = 25, y = 120, z = 25}, + spread = vector.new(25, 120, 25), seed = 2325, octaves = 5, persist = 2, @@ -5781,7 +5800,7 @@ local function register_dimension_decorations() y_max = mcl_vars.mg_nether_deco_max - 50, flags = "all_floors, all ceilings", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", decoration = "mcl_blackstone:basalt", place_on = {"mcl_blackstone:basalt", "mcl_nether:netherrack", "mcl_blackstone:blackstone"}, @@ -5790,7 +5809,7 @@ local function register_dimension_decorations() noise_params = { offset = -0.0085, scale = 0.004, - spread = {x = 25, y = 120, z = 25}, + spread = vector.new(25, 120, 25), seed = 235, octaves = 5, persist = 2.5, @@ -5802,7 +5821,7 @@ local function register_dimension_decorations() y_max = mcl_vars.mg_nether_deco_max - 15, flags = "all_floors, all ceilings", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", decoration = "mcl_blackstone:basalt", place_on = {"mcl_blackstone:basalt", "mcl_nether:netherrack", "mcl_blackstone:blackstone"}, @@ -5814,7 +5833,7 @@ local function register_dimension_decorations() y_max = mcl_vars.mg_nether_deco_max - 15, flags = "all_floors, all ceilings", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", decoration = "mcl_nether:magma", place_on = {"mcl_blackstone:basalt", "mcl_nether:netherrack", "mcl_blackstone:blackstone"}, @@ -5825,7 +5844,7 @@ local function register_dimension_decorations() y_min = mcl_vars.mg_lava_nether_max + 1, flags = "all_floors, all ceilings", }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ deco_type = "simple", decoration = "mcl_nether:nether_lava_source", place_on = {"mcl_blackstone:basalt", "mcl_nether:netherrack", "mcl_blackstone:blackstone"}, @@ -5843,7 +5862,7 @@ local function register_dimension_decorations() --[[ THE END ]] -- Chorus plant - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ name = "mcl_biomes:chorus", deco_type = "simple", place_on = {"mcl_end:end_stone"}, @@ -5852,7 +5871,7 @@ local function register_dimension_decorations() noise_params = { offset = -0.012, scale = 0.024, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 257, octaves = 3, persist = 0.6 @@ -5864,7 +5883,7 @@ local function register_dimension_decorations() height_max = 8, biomes = {"End", "EndMidlands", "EndHighlands", "EndBarrens", "EndSmallIslands"}, }) - minetest.register_decoration({ + mcl_mapgen_core.register_decoration({ name = "mcl_biomes:chorus_plant", deco_type = "simple", place_on = {"mcl_end:chorus_plant"}, @@ -5874,7 +5893,7 @@ local function register_dimension_decorations() --[[noise_params = { offset = -0.012, scale = 0.024, - spread = {x = 100, y = 100, z = 100}, + spread = vector.new(100, 100, 100), seed = 257, octaves = 3, persist = 0.6 @@ -5975,7 +5994,7 @@ if mg_name ~= "singlenode" then for _, pos in ipairs(gennotify["decoration#" .. deco_id_chorus_plant] or {}) do local x, y, z = pos.x, pos.y, pos.z if x < -10 or x > 10 or z < -10 or z > 10 then - local realpos = {x = x, y = y + 1, z = z} + local realpos = vector.new(x, y + 1, z) local node = minetest.get_node(realpos) if node and node.name == "mcl_end:chorus_flower" then mcl_end.grow_chorus_plant(realpos, node, pr) diff --git a/mods/MAPGEN/mcl_mapgen_core/api.lua b/mods/MAPGEN/mcl_mapgen_core/api.lua index f9589f583..c47c43551 100644 --- a/mods/MAPGEN/mcl_mapgen_core/api.lua +++ b/mods/MAPGEN/mcl_mapgen_core/api.lua @@ -169,3 +169,54 @@ function mcl_mapgen_core.unregister_generator(id) if rec.needs_param2 then param2 = param2 - 1 end --if rec.needs_level0 then level0 = level0 - 1 end end + +-- Try to make decorations more deterministic in order, by sorting by priority and name +-- At least for low-priority this should make map seeds more comparable, but +-- adding for example a new structure can still change everything that comes +-- later, because currently decoration blockseeds are incremented sequentially +-- c.f., https://github.com/minetest/minetest/issues/14919 +local minetest_register_decoration = minetest.register_decoration +local pending_decorations = {} +function mcl_mapgen_core.register_decoration(def, callback) + if pending_decorations == nil then + minetest.log("warning", "Decoration registered after mapgen: "..tostring(def.name)) + minetest_register_decoration(def) + if callback ~= nil then callback() end + return + end + def = table.copy(def) -- defensive deep copy, needed for water lily + def.callback = callback + table.insert(pending_decorations, def) +end +local function sort_decorations() + local keys, map = {}, {} + for i, def in pairs(pending_decorations) do + local name = def.name + -- we try to generate fallback names to make order more deterministic + name = name or (def.decoration and string.format("%s:%04d", def.decoration, i)) + if not name and type(def.schematic) == "string" then + local sc = string.split(def.schematic, "/") + name = string.format("%s:%04d", sc[#sc], i) + end + if not name and type(def.schematic) == "table" and def.schematic.data then + name = "" + for _, v in ipairs(def.schematic.data) do + if v.name then name = name .. v.name .. ":" end + end + name = name .. string.format("%04d", i) + end + name = name or string.format("%04d", i) + local prio = (def.priority or 1000) + i/1000 + local key = string.format("%08.3f:%s", prio, name) + table.insert(keys, key) + map[key] = def + end + table.sort(keys) + for _, key in ipairs(keys) do + -- minetest.log("action", "Deco: "..key) + minetest_register_decoration(map[key]) + if map[key].callback then map[key].callback() end + end + pending_decorations = nil -- as we will not run again +end +minetest.register_on_mods_loaded(sort_decorations) diff --git a/mods/MAPGEN/mcl_mapgen_core/v6.lua b/mods/MAPGEN/mcl_mapgen_core/v6.lua index bfdc14c06..9e5ca0542 100644 --- a/mods/MAPGEN/mcl_mapgen_core/v6.lua +++ b/mods/MAPGEN/mcl_mapgen_core/v6.lua @@ -45,6 +45,7 @@ local function register_mgv6_decorations() -- Doubletall grass minetest.register_decoration({ + priority = 1500, deco_type = "schematic", schematic = { size = { x=1, y=3, z=1 }, @@ -81,6 +82,7 @@ local function register_mgv6_decorations() }, -- v6 hack: This makes sure large ferns only appear in jungles spawn_by = { "mcl_core:jungletree", "mcl_flowers:fern" }, + priority = 1510, -- larger than fern num_spawn_by = 1, place_on = {"group:grass_block_no_snow"}, @@ -192,6 +194,7 @@ local function register_mgv6_decorations() }, -- Small trick to make sure melon spawn in jungles spawn_by = { "mcl_core:jungletree", "mcl_flowers:fern" }, + priority = 1510, -- larger than fern num_spawn_by = 1, y_min = 1, y_max = 40, @@ -214,6 +217,7 @@ local function register_mgv6_decorations() y_min = 1, y_max = mcl_vars.overworld_max, decoration = "mcl_flowers:tallgrass", + priority = 1500, }) minetest.register_decoration({ deco_type = "simple", @@ -230,6 +234,7 @@ local function register_mgv6_decorations() y_min = 1, y_max = mcl_vars.overworld_max, decoration = "mcl_flowers:tallgrass", + priority = 1500, }) -- Seagrass and kelp @@ -256,6 +261,7 @@ local function register_mgv6_decorations() y_min = mcl_vars.overworld_min, y_max = 0, decoration = "mcl_ocean:seagrass_"..mat, + priority = 1500, }) minetest.register_decoration({ deco_type = "simple", @@ -276,6 +282,7 @@ local function register_mgv6_decorations() y_min = mcl_vars.overworld_min, y_max = -5, decoration = "mcl_ocean:seagrass_"..mat, + priority = 1500, }) minetest.register_decoration({ @@ -356,6 +363,7 @@ local function register_mgv6_decorations() y_min = 1, y_max = mcl_vars.overworld_max, decoration = "mcl_flowers:tallgrass", + priority = 1500, }) local mushrooms = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown"} diff --git a/mods/MAPGEN/mcl_structures/api.lua b/mods/MAPGEN/mcl_structures/api.lua index a76140e61..e6368f2cf 100644 --- a/mods/MAPGEN/mcl_structures/api.lua +++ b/mods/MAPGEN/mcl_structures/api.lua @@ -326,7 +326,6 @@ function mcl_structures.place_structure(pos, def, pr, blockseed, rot) end local EMPTY_SCHEMATIC = { size = {x = 0, y = 0, z = 0}, data = { } } - function mcl_structures.register_structure(name,def,nospawn) --nospawn means it will not be placed by mapgen decoration mechanism if mcl_structures.is_disabled(name) then return end flags = def.flags or "place_center_x, place_center_z, force_placement" @@ -335,6 +334,7 @@ function mcl_structures.register_structure(name,def,nospawn) --nospawn means it minetest.register_on_mods_loaded(function() --make sure all previous decorations and biomes have been registered def.deco = minetest.register_decoration({ name = "mcl_structures:deco_"..name, + priority = def.priority or (def.terrain_feature and 900) or 100, -- run before regular decorations deco_type = "schematic", schematic = EMPTY_SCHEMATIC, place_on = def.place_on, diff --git a/mods/MAPGEN/mcl_terrain_features/init.lua b/mods/MAPGEN/mcl_terrain_features/init.lua index acd40ca0f..9a660bc3d 100644 --- a/mods/MAPGEN/mcl_terrain_features/init.lua +++ b/mods/MAPGEN/mcl_terrain_features/init.lua @@ -134,6 +134,7 @@ local function get_fallen_tree_schematic(pos,pr) end mcl_structures.register_structure("fallen_tree",{ + priority = 1100, -- after regular trees place_on = {"group:grass_block"}, terrain_feature = true, noise_params = { @@ -151,12 +152,9 @@ mcl_structures.register_structure("fallen_tree",{ y_min = minetest.get_mapgen_setting("water_level"), on_place = function(pos,def,pr) local air_p1 = vector.offset(pos,-def.sidelen/2,1,-def.sidelen/2) - local air_p2 = vector.offset(pos,def.sidelen/2,1,def.sidelen/2) + local air_p2 = vector.offset(air_p1,def.sidelen-1,0,def.sidelen-1) local air = minetest.find_nodes_in_area(air_p1,air_p2,{"air"}) - if #air < ( def.sidelen * def.sidelen ) / 2 then - return false - end - return true + return #air >= (def.sidelen * def.sidelen) / 2 end, place_func = function(pos,def,pr) local schem=get_fallen_tree_schematic(pos,pr)