[dye] init.lua: Check for available flower colors before registering dye
recipes.master
parent
2e941cb780
commit
b5ddf33617
|
@ -58,12 +58,20 @@ for _, row in ipairs(dyes) do
|
||||||
description = description,
|
description = description,
|
||||||
groups = groups
|
groups = groups
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Compare color against flowers
|
||||||
|
if minetest.get_modpath('flowers') then
|
||||||
|
for I in pairs(flowers.colors) do
|
||||||
|
if name == flowers.colors[I] then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = item_name .. " 4",
|
output = item_name .. " 4",
|
||||||
recipe = {"group:flower,color_" .. name},
|
recipe = {"group:flower,color_" .. name},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Manually add coal->black dye
|
-- Manually add coal->black dye
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue