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)