From 48189cb3a76fc385981d5b9bee8ccfb9e5c4a86a Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 17 Jun 2022 23:12:37 +0200 Subject: [PATCH] fix lighting issue for placed schematics warped and crimson shroomlight would not work correctly before because they're placed after light calculation is done apparently --- mods/MAPGEN/mcl_biomes/init.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index f7ab76877..ea2322a9a 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -4114,6 +4114,7 @@ local function register_dimension_decorations() }) minetest.register_decoration({ deco_type = "schematic", + name = "mcl_biomes:warped_tree", place_on = {"mcl_crimson:warped_nylium"}, sidelen = 16, fill_ratio = 0.022, @@ -4161,6 +4162,7 @@ local function register_dimension_decorations() }) minetest.register_decoration({ deco_type = "schematic", + name = "mcl_biomes:crimson_tree", place_on = {"mcl_crimson:crimson_nylium"}, sidelen = 16, fill_ratio = 0.022, @@ -4317,10 +4319,14 @@ if mg_name ~= "singlenode" then -- Overworld decorations for v6 are handled in mcl_mapgen_core - if deco_id_chorus_plant then + local deco_id_crimson_tree =minetest.get_decoration_id("mcl_biomes:crimson_tree") + local deco_id_warped_tree =minetest.get_decoration_id("mcl_biomes:warped_tree") + minetest.set_gen_notify({decoration=true}, { deco_id_crimson_tree }) + minetest.set_gen_notify({decoration=true}, { deco_id_warped_tree }) + if deco_id_chorus_plant or deco_id_crimson_tree or deco_id_warped_tree then mcl_mapgen_core.register_generator("chorus_grow", nil, function(minp, maxp, blockseed) + if minp.y > -26900 then return end local gennotify = minetest.get_mapgen_object("gennotify") - --local poslist = {} local pr = PseudoRandom(blockseed + 14) for _, pos in ipairs(gennotify["decoration#"..deco_id_chorus_plant] or {}) do local x, y, z = pos.x, pos.y, pos.z @@ -4332,6 +4338,13 @@ if mg_name ~= "singlenode" then end end end + if minp.y > mcl_vars.mg_nether_max then return end + for _, pos in ipairs(gennotify["decoration#"..deco_id_crimson_tree] or {}) do + minetest.fix_light(vector.offset(pos,-8,-8,-8),vector.offset(pos,8,8,8)) + end + for _, pos in ipairs(gennotify["decoration#"..deco_id_warped_tree] or {}) do + minetest.fix_light(vector.offset(pos,-8,-8,-8),vector.offset(pos,8,8,8)) + end end) end