Only register dye crafts from flower group if flower exists

This commit is contained in:
James Stevenson 2016-02-28 13:26:45 -05:00
parent 5d28040915
commit 2320f23047

View file

@ -39,12 +39,19 @@ for _, row in ipairs(dyelocal.dyes) do
description = description, description = description,
groups = groups groups = groups
}) })
local flowers = {"white", "violet", "blue", "yellow", "orange", "red"}
for i=1, #flowers do
if flowers[i] == name 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
-- manually add coal->black dye -- manually add coal->black dye
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",