From d53ea65da83de14efcf827b3b14c1b6cd47b0eaa Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Mon, 3 Apr 2023 14:32:02 +0000 Subject: [PATCH 1/9] Remove some code Some code has been moved to `mcl_mapgen_core` for consistency. --- mods/ITEMS/mcl_ocean/seagrass.lua | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/mods/ITEMS/mcl_ocean/seagrass.lua b/mods/ITEMS/mcl_ocean/seagrass.lua index 26640aa3a..328328993 100644 --- a/mods/ITEMS/mcl_ocean/seagrass.lua +++ b/mods/ITEMS/mcl_ocean/seagrass.lua @@ -149,28 +149,3 @@ end if mod_doc then doc.add_entry_alias("nodes", "mcl_ocean:seagrass_dirt", "craftitems", "mcl_ocean:seagrass") end - -minetest.register_lbm({ - label = "Fix incorrect seagrass", - name = "mcl_ocean:fix_incorrect_seagrass", - nodenames = {"group:seagrass"}, - run_at_every_load = false, - action = function(pos, node) - if node.param2 ~= 3 then - node.param2 = 3 - minetest.set_node(pos, node) - end - end -}) - -minetest.register_on_generated(function(minp, maxp, blockseed) - local seagrass = minetest.find_nodes_in_area(minp, maxp, {"group:seagrass"}) - for _, sgpos in pairs(seagrass) do - local sgnode = minetest.get_node(sgpos) - if sgnode.param2 ~= 3 then - sgnode.param2 = 3 - minetest.set_node(sgpos, sgnode) - end - end -end -) From 76bf98b26c29f2a68163d9b04c8482007ef43379 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Mon, 3 Apr 2023 14:35:24 +0000 Subject: [PATCH 2/9] Use voxelmanip to set the correct param2 for nodes Voxelmanip is now used to set the correct `param2` for the nodes which use biome colouring or, in the case of seagrass, the correct meshoption. --- mods/MAPGEN/mcl_mapgen_core/init.lua | 154 ++++++++++++++++++--------- 1 file changed, 106 insertions(+), 48 deletions(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 9e401a4ff..13aeb1841 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -290,6 +290,60 @@ local function set_grass_palette(minp,maxp,data2,area,biomemap,nodes) return lvm_used end +local function set_foliage_palette(minp,maxp,data2,area,biomemap,nodes) + -- Flat area at y=0 to read biome 3 times faster than 5.3.0.get_biome_data(pos).biome: 43us vs 125us per iteration: + if not biomemap then return end + local aream = VoxelArea:new({MinEdge={x=minp.x, y=0, z=minp.z}, MaxEdge={x=maxp.x, y=0, z=maxp.z}}) + local nodes = minetest.find_nodes_in_area(minp, maxp, nodes) + for n=1, #nodes do + local n = nodes[n] + local p_pos = area:index(n.x, n.y, n.z) + local b_pos = aream:index(n.x, 0, n.z) + local bn = minetest.get_biome_name(biomemap[b_pos]) + if bn then + local biome = minetest.registered_biomes[bn] + if biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index then + data2[p_pos] = biome._mcl_foliage_palette_index + lvm_used = true + end + end + end + return lvm_used +end + +local function set_water_palette(minp,maxp,data2,area,biomemap,nodes) + -- Flat area at y=0 to read biome 3 times faster than 5.3.0.get_biome_data(pos).biome: 43us vs 125us per iteration: + if not biomemap then return end + local aream = VoxelArea:new({MinEdge={x=minp.x, y=0, z=minp.z}, MaxEdge={x=maxp.x, y=0, z=maxp.z}}) + local nodes = minetest.find_nodes_in_area(minp, maxp, nodes) + for n=1, #nodes do + local n = nodes[n] + local p_pos = area:index(n.x, n.y, n.z) + local b_pos = aream:index(n.x, 0, n.z) + local bn = minetest.get_biome_name(biomemap[b_pos]) + if bn then + local biome = minetest.registered_biomes[bn] + if biome and biome._mcl_biome_type and biome._mcl_water_palette_index then + data2[p_pos] = biome._mcl_water_palette_index + lvm_used = true + end + end + end + return lvm_used +end + +local function set_seagrass_param2(minp,maxp,data2,area,biomemap,nodes) + local aream = VoxelArea:new({MinEdge={x=minp.x, y=0, z=minp.z}, MaxEdge={x=maxp.x, y=0, z=maxp.z}}) + local nodes = minetest.find_nodes_in_area(minp, maxp, nodes) + for n=1, #nodes do + local n = nodes[n] + local p_pos = area:index(n.x, n.y, n.z) + data2[p_pos] = 3 + lvm_used = true + end + return lvm_used +end + -- Below the bedrock, generate air/void local function world_structure(vm, data, data2, emin, emax, area, minp, maxp, blockseed) local biomemap --ymin, ymax @@ -346,23 +400,47 @@ local function world_structure(vm, data, data2, emin, emax, area, minp, maxp, bl end local function block_fixes_grass(vm, data, data2, emin, emax, area, minp, maxp, blockseed) - if maxp.y < mcl_vars.mg_overworld_min then - --minetest.log("Exit grass fix") - return - else - --minetest.log("Grass fixes") - end - - local biomemap = minetest.get_mapgen_object("biomemap") - local lvm_used = false - - if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then - -- Set param2 (=color) of nodes which use the grass colour palette. - lvm_used = set_grass_palette(minp,maxp,data2,area,biomemap,{"group:grass_palette"}) - end - return lvm_used + local biomemap = minetest.get_mapgen_object("biomemap") + local lvm_used = false + local pr = PseudoRandom(blockseed) + if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then + -- Set param2 (=color) of nodes which use the grass colour palette. + lvm_used = set_grass_palette(minp,maxp,data2,area,biomemap,{"group:grass_palette"}) + end + return lvm_used end +local function block_fixes_foliage(vm, data, data2, emin, emax, area, minp, maxp, blockseed) + local biomemap = minetest.get_mapgen_object("biomemap") + local lvm_used = false + local pr = PseudoRandom(blockseed) + if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then + -- Set param2 (=color) of nodes which use the foliage colour palette. + lvm_used = set_foliage_palette(minp,maxp,data2,area,biomemap,{"group:foliage_palette"}) + end + return lvm_used +end + +local function block_fixes_water(vm, data, data2, emin, emax, area, minp, maxp, blockseed) + local biomemap = minetest.get_mapgen_object("biomemap") + local lvm_used = false + local pr = PseudoRandom(blockseed) + if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then + -- Set param2 (=color) of nodes which use the water colour palette. + lvm_used = set_water_palette(minp,maxp,data2,area,biomemap,{"group:water_palette"}) + end + return lvm_used +end + +local function block_fixes_seagrass(vm, data, data2, emin, emax, area, minp, maxp, blockseed) + local lvm_used = false + local pr = PseudoRandom(blockseed) + if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then + -- Set param2 of seagrass to 3. + lvm_used = set_seagrass_param2(minp,maxp,data2,area,biomemap,{"group:seagrass"}) + end + return lvm_used +end -- End block fixes: local function end_basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) @@ -391,6 +469,9 @@ end, 9999, true) if mg_name ~= "v6" and mg_name ~= "singlenode" then mcl_mapgen_core.register_generator("block_fixes_grass", block_fixes_grass, nil, 9999, true) + mcl_mapgen_core.register_generator("block_fixes_foliage", block_fixes_foliage, nil, 9999, true) + mcl_mapgen_core.register_generator("block_fixes_water", block_fixes_water, nil, 9999, true) + mcl_mapgen_core.register_generator("block_fixes_seagrass", block_fixes_seagrass, nil, 9999, true) end if mg_name == "v6" then @@ -467,28 +548,6 @@ minetest.register_lbm({ end }) -minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct palette indexes of foliage in new mapblocks. - local pos1, pos2 = vector.offset(minp, -16, -16, -16), vector.offset(maxp, 16, 16, 16) - local foliage = minetest.find_nodes_in_area(pos1, pos2, {"group:foliage_palette", "group:foliage_palette_wallmounted"}) - for _, fpos in pairs(foliage) do - local fnode = minetest.get_node(fpos) - local foliage_palette_index = mcl_util.get_palette_indexes_from_pos(fpos).foliage_palette_index - if fnode.param2 ~= foliage_palette_index and fnode.name ~= "mcl_core:vine" then - fnode.param2 = foliage_palette_index - minetest.set_node(fpos, fnode) - elseif fnode.name == "mcl_core:vine" then - local biome_param2 = foliage_palette_index - local rotation_param2 = mcl_util.get_colorwallmounted_rotation(fpos) - local final_param2 = (biome_param2 * 8) + rotation_param2 - if fnode.param2 ~= final_param2 then - fnode.param2 = final_param2 - minetest.set_node(fpos, fnode) - end - end - end -end -) - minetest.register_lbm({ label = "Fix water palette indexes", -- Set correct palette indexes of water in old mapblocks. name = "mcl_mapgen_core:fix_water_palette_indexes", @@ -503,16 +562,15 @@ minetest.register_lbm({ end }) -minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct palette indexes of water in new mapblocks. - local pos1, pos2 = vector.offset(minp, -16, -16, -16), vector.offset(maxp, 16, 16, 16) - local water = minetest.find_nodes_in_area(pos1, pos2, {"group:water_palette"}) - for _, wpos in pairs(water) do - local wnode = minetest.get_node(wpos) - local water_palette_index = mcl_util.get_palette_indexes_from_pos(wpos).water_palette_index - if wnode.param2 ~= water_palette_index then - wnode.param2 = water_palette_index - minetest.set_node(wpos, wnode) +minetest.register_lbm({ + label = "Fix incorrect seagrass", -- Set correct param2 of seagrass in old mapblocks. + name = "mcl_mapgen_core:fix_incorrect_seagrass", + nodenames = {"group:seagrass"}, + run_at_every_load = false, + action = function(pos, node) + if node.param2 ~= 3 then + node.param2 = 3 + minetest.set_node(pos, node) end end -end -) +}) From d8d83dd21cbe3eda2b73f217fe5c73e0d7f1081a Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Tue, 4 Apr 2023 10:59:28 +0000 Subject: [PATCH 3/9] Make vines use voxelmanip colouring as well This commit adds some code to the `set_foliage_palette` function which checks for the `param2` of the foliage node in question to see whether or not said `param2` value is `0` upon first being generated. If it isn't, then it's safe to assume that said foliage is a vine, and therefore needs to use the other method of calculating the final `param2` value. --- mods/MAPGEN/mcl_mapgen_core/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 13aeb1841..401532c07 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -302,9 +302,12 @@ local function set_foliage_palette(minp,maxp,data2,area,biomemap,nodes) local bn = minetest.get_biome_name(biomemap[b_pos]) if bn then local biome = minetest.registered_biomes[bn] - if biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index then + if biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index and data2[p_pos] == 0 then data2[p_pos] = biome._mcl_foliage_palette_index lvm_used = true + elseif biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index and data2[p_pos] ~= 0 then + data2[p_pos] = (biome._mcl_foliage_palette_index * 8) + data2[p_pos] + lvm_used = true end end end @@ -416,7 +419,7 @@ local function block_fixes_foliage(vm, data, data2, emin, emax, area, minp, maxp local pr = PseudoRandom(blockseed) if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then -- Set param2 (=color) of nodes which use the foliage colour palette. - lvm_used = set_foliage_palette(minp,maxp,data2,area,biomemap,{"group:foliage_palette"}) + lvm_used = set_foliage_palette(minp,maxp,data2,area,biomemap,{"group:foliage_palette", "group:foliage_palette_wallmounted"}) end return lvm_used end From aac6af4c20e8453c526725c60dcbd6403bef9652 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Fri, 7 Apr 2023 07:30:05 +0000 Subject: [PATCH 4/9] Small change to account for mangrove leaves --- mods/MAPGEN/mcl_mapgen_core/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 401532c07..153da255b 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -305,7 +305,7 @@ local function set_foliage_palette(minp,maxp,data2,area,biomemap,nodes) if biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index and data2[p_pos] == 0 then data2[p_pos] = biome._mcl_foliage_palette_index lvm_used = true - elseif biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index and data2[p_pos] ~= 0 then + elseif biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index and data2[p_pos] > 1 then data2[p_pos] = (biome._mcl_foliage_palette_index * 8) + data2[p_pos] lvm_used = true end From d28dcb1b10b96fd8f3ea6ea7317d7710ccd73b6d Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Fri, 7 Apr 2023 07:36:01 +0000 Subject: [PATCH 5/9] Another small change to account for mangrove leaves This one should actually work as expected. --- mods/MAPGEN/mcl_mapgen_core/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 153da255b..a6930bc2e 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -302,7 +302,7 @@ local function set_foliage_palette(minp,maxp,data2,area,biomemap,nodes) local bn = minetest.get_biome_name(biomemap[b_pos]) if bn then local biome = minetest.registered_biomes[bn] - if biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index and data2[p_pos] == 0 then + if biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index and data2[p_pos] <= 1 then data2[p_pos] = biome._mcl_foliage_palette_index lvm_used = true elseif biome and biome._mcl_biome_type and biome._mcl_foliage_palette_index and data2[p_pos] > 1 then From 01ac9ad685685666a87cda4cab6466dc97ef364a Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Sun, 16 Apr 2023 09:55:05 +0000 Subject: [PATCH 6/9] Add old method back for foliage This commit adds back the old `set_node` method for the foliage, since the foliage is much more difficult to work with via the VoxelManip method due to them being part of schematics that could span across mapblocks in some cases. The old method will complement the new one by running after the VoxelManip has done its job, and fixes any foliage that the VoxelManip had missed. --- mods/MAPGEN/mcl_mapgen_core/init.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index a6930bc2e..8154bb66b 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -577,3 +577,25 @@ minetest.register_lbm({ end end }) + +minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct palette indexes of missed foliage. + local pos1, pos2 = vector.offset(minp, -16, -16, -16), vector.offset(maxp, 16, 16, 16) + local foliage = minetest.find_nodes_in_area(pos1, pos2, {"group:foliage_palette", "group:foliage_palette_wallmounted"}) + for _, fpos in pairs(foliage) do + local fnode = minetest.get_node(fpos) + local foliage_palette_index = mcl_util.get_palette_indexes_from_pos(fpos).foliage_palette_index + if fnode.param2 ~= foliage_palette_index and fnode.name ~= "mcl_core:vine" then + fnode.param2 = foliage_palette_index + minetest.set_node(fpos, fnode) + elseif fnode.name == "mcl_core:vine" then + local biome_param2 = foliage_palette_index + local rotation_param2 = mcl_util.get_colorwallmounted_rotation(fpos) + local final_param2 = (biome_param2 * 8) + rotation_param2 + if fnode.param2 ~= final_param2 then + fnode.param2 = final_param2 + minetest.set_node(fpos, fnode) + end + end + end +end +) From 31b65bac91745cb29f0038d6ad233e9b0d82569f Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Sun, 16 Apr 2023 17:08:48 +0100 Subject: [PATCH 7/9] Move generator code to functions to aid in profiling --- mods/MAPGEN/mcl_mapgen_core/api.lua | 68 ++++++++++++++++++----------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/api.lua b/mods/MAPGEN/mcl_mapgen_core/api.lua index 630270444..978fb7cda 100644 --- a/mods/MAPGEN/mcl_mapgen_core/api.lua +++ b/mods/MAPGEN/mcl_mapgen_core/api.lua @@ -11,6 +11,43 @@ local function roundN(n, d) return math.floor(n * m + 0.5) / m end +local function run_generators (p1, p2, blockseed) + if nodes > 0 then + for _, rec in ipairs(registered_generators) do + if rec.nf then + rec.nf(p1, p2, blockseed) + end + end + end +end + +local function update_data (vm, data, data2) + -- Write stuff + vm:set_data(data) + if param2 > 0 then + vm:set_param2_data(data2) + end +end + +local function post_generator_processing(vm, minp, maxp, deco_used, deco_table, ore_used, ore_table) + if deco_table then + minetest.generate_decorations(vm,vector.new(minp.x,deco_table.min,minp.z),vector.new(maxp.x,deco_table.max,maxp.z)) + elseif deco_used then + minetest.generate_decorations(vm) + end + if ore_table then + minetest.generate_ores(vm,vector.new(minp.x,ore_table.min,minp.z),vector.new(maxp.x,ore_table.max,maxp.z)) + elseif ore_used then + minetest.generate_ores(vm) + end +end + +local function post_generator_processing_2(vm, p1, p2, shadow) + vm:calc_lighting(p1, p2, shadow) + vm:write_to_map() + vm:update_liquids() +end + minetest.register_on_generated(function(minp, maxp, blockseed) local t1 = os.clock() local p1, p2 = {x=minp.x, y=minp.y, z=minp.z}, {x=maxp.x, y=maxp.y, z=maxp.z} @@ -49,34 +86,13 @@ minetest.register_on_generated(function(minp, maxp, blockseed) end if lvm_used then - -- Write stuff - vm:set_data(data) - if param2 > 0 then - vm:set_param2_data(data2) - end - if deco_table then - minetest.generate_decorations(vm,vector.new(minp.x,deco_table.min,minp.z),vector.new(maxp.x,deco_table.max,maxp.z)) - elseif deco_used then - minetest.generate_decorations(vm) - end - if ore_table then - minetest.generate_ores(vm,vector.new(minp.x,ore_table.min,minp.z),vector.new(maxp.x,ore_table.max,maxp.z)) - elseif ore_used then - minetest.generate_ores(vm) - end - vm:calc_lighting(p1, p2, shadow) - vm:write_to_map() - vm:update_liquids() + update_data (vm, data, data2) + post_generator_processing(vm, minp, maxp, deco_used, deco_table, ore_used, ore_table) + post_generator_processing_2(vm, p1, p2, shadow) end end - if nodes > 0 then - for _, rec in ipairs(registered_generators) do - if rec.nf then - rec.nf(p1, p2, blockseed) - end - end - end + run_generators (p1, p2, blockseed) mcl_vars.add_chunk(minp) if logging then @@ -84,6 +100,8 @@ minetest.register_on_generated(function(minp, maxp, blockseed) end end) + + function minetest.register_on_generated(node_function) mcl_mapgen_core.register_generator("mod_"..minetest.get_current_modname().."_"..tostring(#registered_generators+1), nil, node_function) end From 1015f5a569e2494cc9d8caaf9848b97fe416edfd Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Sun, 16 Apr 2023 17:10:17 +0100 Subject: [PATCH 8/9] Optimize folliage fixes code --- mods/MAPGEN/mcl_mapgen_core/init.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 8154bb66b..467d02134 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -578,8 +578,11 @@ minetest.register_lbm({ end }) -minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct palette indexes of missed foliage. - local pos1, pos2 = vector.offset(minp, -16, -16, -16), vector.offset(maxp, 16, 16, 16) +-- We go outside x and y for where trees are placed next to a biome that has already been generated. +-- We go above maxp.y because trees can often get placed close to the top of a generated area and folliage may not +-- be coloured correctly. +local function fix_folliage_missed (minp, maxp) + local pos1, pos2 = vector.offset(minp, -4, 0, -4), vector.offset(maxp, 4, 10, 4) local foliage = minetest.find_nodes_in_area(pos1, pos2, {"group:foliage_palette", "group:foliage_palette_wallmounted"}) for _, fpos in pairs(foliage) do local fnode = minetest.get_node(fpos) @@ -598,4 +601,10 @@ minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct pa end end end -) + +minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct palette indexes of missed foliage. + if maxp.y < 0 then + return + end + fix_folliage_missed (minp, maxp) +end) From 3b1464ecc88d73eb7d2c9c0d3276f4aeff05bd0e Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Sun, 16 Apr 2023 17:49:27 +0100 Subject: [PATCH 9/9] Tweak leaf generator numbers to catch missed jungle leaves --- mods/MAPGEN/mcl_mapgen_core/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 467d02134..e6420f91d 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -582,7 +582,7 @@ minetest.register_lbm({ -- We go above maxp.y because trees can often get placed close to the top of a generated area and folliage may not -- be coloured correctly. local function fix_folliage_missed (minp, maxp) - local pos1, pos2 = vector.offset(minp, -4, 0, -4), vector.offset(maxp, 4, 10, 4) + local pos1, pos2 = vector.offset(minp, -6, 0, -6), vector.offset(maxp, 6, 14, 6) local foliage = minetest.find_nodes_in_area(pos1, pos2, {"group:foliage_palette", "group:foliage_palette_wallmounted"}) for _, fpos in pairs(foliage) do local fnode = minetest.get_node(fpos)