Merge pull request #178 from Niklp09/fix_flower_detection

Fix flowers detection when using ethereal
This commit is contained in:
Joachim Stolberg 2024-07-03 21:19:27 +02:00 committed by GitHub
commit 885d25a4a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)