From 0bcbea4ce3de2a826a14707724645393795aef50 Mon Sep 17 00:00:00 2001 From: cora Date: Wed, 10 Aug 2022 13:52:19 +0200 Subject: [PATCH] Add lots of water lakes to mangrove swamps --- mods/MAPGEN/mcl_terrain_features/init.lua | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/mods/MAPGEN/mcl_terrain_features/init.lua b/mods/MAPGEN/mcl_terrain_features/init.lua index 052f99c8d..eab33e78e 100644 --- a/mods/MAPGEN/mcl_terrain_features/init.lua +++ b/mods/MAPGEN/mcl_terrain_features/init.lua @@ -29,7 +29,7 @@ local function airtower(pos,tbl,h) end end -local function makelake(pos,size,liquid,placein,border,pr) +local function makelake(pos,size,liquid,placein,border,pr,noair) local node_under = minetest.get_node(vector.offset(pos,0,-1,0)) local p1 = vector.offset(pos,-size,-1,-size) local p2 = vector.offset(pos,size,-1,size) @@ -70,7 +70,7 @@ local function makelake(pos,size,liquid,placein,border,pr) end if border == nil or border == "mcl_core:dirt" then border = "mcl_core:dirt_with_grass" end end - if an.name ~= liquid then + if not noair and an.name ~= liquid then table.insert(br,pp) if un.name ~= liquid then airtower(pp,air,55) @@ -209,6 +209,27 @@ mcl_structures.register_structure("water_lake",{ end }) +mcl_structures.register_structure("water_lake_mangrove_swamp",{ + place_on = {"mcl_mud:mud"}, + biomes = { "MangroveSwamp" }, + terrain_feature = true, + noise_params = { + offset = 0, + scale = 0.0032, + spread = {x = 250, y = 250, z = 250}, + seed = 6343241353, + 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"), + place_func = function(pos,def,pr) + return makelake(pos,3,"mcl_core:water_source",{"group:material_stone", "group:sand", "group:dirt","group:grass_block","mcl_mud:mud"},"mcl_mud:mud",pr,true) + end +}) + local pool_adjacents = { vector.new(1,0,0), vector.new(-1,0,0),