From 726d1f07fa88a4a094a78587dd7ad13db2c87363 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 13 Jun 2022 11:59:15 +0200 Subject: [PATCH] use noise instead of fill_ratio for distribution --- mods/MAPGEN/mcl_geodes/init.lua | 14 +++++++++++--- mods/MAPGEN/mcl_shipwrecks/init.lua | 12 ++++++++++-- mods/MAPGEN/mcl_structures/api.lua | 2 +- mods/MAPGEN/mcl_surface_pools/init.lua | 22 +++++++++++++++++++--- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/mods/MAPGEN/mcl_geodes/init.lua b/mods/MAPGEN/mcl_geodes/init.lua index 2481398092..84acd973b7 100644 --- a/mods/MAPGEN/mcl_geodes/init.lua +++ b/mods/MAPGEN/mcl_geodes/init.lua @@ -51,7 +51,7 @@ local function makegeode(pos,pr) for _,v in pairs(calcite) do for _,vv in pairs(minetest.find_nodes_in_area(vector.offset(v,-1,-1,-1),vector.offset(v,1,1,1),{"group:material_stone"})) do - set_node_no_bedrock(vv,{name="mcl_deepslate:deepslate"}) --Replace with smooth basalt when available + set_node_no_bedrock(vv,{name="mcl_blackstone:basalt_smooth"}) end end @@ -66,7 +66,15 @@ end mcl_structures.register_structure("geode",{ place_on = {"mcl_core:stone"}, - fill_ratio = 0.0001, + noise_params = { + offset = 0, + scale = 0.00022, + spread = {x = 250, y = 250, z = 250}, + seed = 7894353, + octaves = 3, + persist = 0.001, + flags = "absvalue", + }, flags = "place_center_x, place_center_z, force_placement", biomes = ocean_biomes, y_max = -24, @@ -75,6 +83,6 @@ mcl_structures.register_structure("geode",{ y_offset = function(pr) return pr:next(-4,-2) end, place_func = function(pos,def,pr) local p = vector.new(pos.x + pr:next(-30,30),pos.y,pos.z + pr:next(-30,30)) - return makegeode(pos,pr) + return makegeode(p,pr) end }) diff --git a/mods/MAPGEN/mcl_shipwrecks/init.lua b/mods/MAPGEN/mcl_shipwrecks/init.lua index b2c0c3306b..a3861a2c92 100644 --- a/mods/MAPGEN/mcl_shipwrecks/init.lua +++ b/mods/MAPGEN/mcl_shipwrecks/init.lua @@ -158,8 +158,16 @@ mcl_structures.register_structure("shipwreck",{ place_on = {"group:sand","mcl_core:gravel"}, spawn_by = {"group:water"}, num_spawn_by = 4, - fill_ratio = 0.00002, - flags = "place_center_x, place_center_z, force_placement", + noise_params = { + offset = 0, + scale = 0.000022, + spread = {x = 250, y = 250, z = 250}, + seed = 3, + octaves = 3, + persist = 0.001, + flags = "absvalue", + }, + flags = "force_placement", biomes = ocean_biomes, y_max = water_level-4, y_min = mcl_vars.mg_overworld_min, diff --git a/mods/MAPGEN/mcl_structures/api.lua b/mods/MAPGEN/mcl_structures/api.lua index 2235d44053..b3d0491eea 100644 --- a/mods/MAPGEN/mcl_structures/api.lua +++ b/mods/MAPGEN/mcl_structures/api.lua @@ -43,7 +43,7 @@ function mcl_structures.register_structure(name,def,nospawn) --nospawn means it num_spawn_by = def.num_spawn_by, sidelen = 80, fill_ratio = def.fill_ratio, - noise = def.noise, + noise_params = def.noise_params, flags = flags, biomes = def.biomes, y_max = def.y_max, diff --git a/mods/MAPGEN/mcl_surface_pools/init.lua b/mods/MAPGEN/mcl_surface_pools/init.lua index 8dfa9ca400..ed42f52bbd 100644 --- a/mods/MAPGEN/mcl_surface_pools/init.lua +++ b/mods/MAPGEN/mcl_surface_pools/init.lua @@ -17,7 +17,7 @@ local function set_node_no_bedrock(pos,node) end local function airtower(pos) - for i=0,35 do + for i=0,55 do set_node_no_bedrock(vector.offset(pos,0,i,0),{name="air"}) end end @@ -69,7 +69,15 @@ end mcl_structures.register_structure("lavapool",{ place_on = {"group:sand", "group:dirt", "group:stone"}, - fill_ratio = 0.000015, + noise_params = { + offset = 0, + scale = 0.0000022, + spread = {x = 250, y = 250, z = 250}, + seed = 78375213, + octaves = 3, + persist = 0.001, + flags = "absvalue", + }, flags = "place_center_x, place_center_z, force_placement", y_max = mcl_vars.mg_overworld_max, y_min = minetest.get_mapgen_setting("water_level"), @@ -80,7 +88,15 @@ mcl_structures.register_structure("lavapool",{ mcl_structures.register_structure("water_lake",{ place_on = {"group:dirt","group:stone"}, - fill_ratio = 0.000052, + noise_params = { + offset = 0, + scale = 0.000032, + spread = {x = 250, y = 250, z = 250}, + seed = 734341353, + octaves = 3, + persist = 0.001, + flags = "absvalue", + }, flags = "place_center_x, place_center_z, force_placement", y_max = mcl_vars.mg_overworld_max, y_min = minetest.get_mapgen_setting("water_level"),