[dye] init.lua: Check for available flower colors before registering dye

recipes.
master
AntumDeluge 2016-09-06 04:58:28 -07:00
parent 2e941cb780
commit b5ddf33617
1 changed files with 13 additions and 5 deletions

View File

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