From abd945d5bcb9a3370f892a9d04a2eb482ac0b874 Mon Sep 17 00:00:00 2001 From: Niklp Date: Wed, 3 Jul 2024 20:50:57 +0200 Subject: [PATCH] Fix flowers detection when using ethereal --- lamps/growlight.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lamps/growlight.lua b/lamps/growlight.lua index 31cb901..c592eb6 100644 --- a/lamps/growlight.lua +++ b/lamps/growlight.lua @@ -192,14 +192,22 @@ function techage.register_plant(name) end minetest.after(1, function() + local function add_flower(name) + local def = minetest.registered_nodes[name] + if def and (def.groups.mushroom == 1 or def.groups.flower == 1) then + if not Ignore[name] then + techage.register_flower(name) + end + end + end + for _,def in pairs(minetest.registered_decorations) do local name = def.decoration - if name and type(name) == "string" then - local mod = string.split(name, ":")[1] - if mod == "flowers" or mod == "bakedclay" then -- Bakedclay also registers flowers as decoration. - if not Ignore[name] then - techage.register_flower(name) - end + if type(name) == "string" then + add_flower(name) + elseif type(name) == "table" then + for _,sub_name in ipairs(name) do + add_flower(sub_name) end end end @@ -213,5 +221,4 @@ minetest.after(1, function() end end end - -- print(dump(Flowers)) end)