Tidy up recipes

master
ezhh 2017-07-02 15:11:14 +01:00
parent 931a29427c
commit ccc6627bf3
1 changed files with 22 additions and 38 deletions

View File

@ -1,55 +1,39 @@
local recipe_list
local modname
-- recipes when caverealms is present
if minetest.get_modpath("caverealms") then
local recipe_list = {
recipe_list = {
{"black", "spike",}, {"blue", "glow_crystal",},
{"cyan", "glow_gem",}, {"green", "glow_emerald",},
{"magenta", "salt_gem",}, {"orange", "fire_vine",},
{"purple", "glow_amethyst",}, {"red", "glow_ruby",},
{"yellow", "glow_mese",}, {"white", "glow_ore",},
}
for _, item in pairs(recipe_list) do
local colour = item[1]
local ingredient = item[2]
minetest.register_craft({
output = "abritorch:torch_"..colour.." 4",
recipe = {
{"default:torch", "", "default:torch" },
{"", "caverealms:"..ingredient, "" },
{"default:torch", "", "default:torch" },
}
})
end
modname = "caverealms"
-- recipes when caverealms not present
else
-- recipes when caverealms not present
local recipe_list = {
recipe_list = {
{"black", "black",}, {"blue", "blue",},
{"cyan", "cyan",}, {"green", "green",},
{"magenta", "magenta",}, {"orange", "orange",},
{"purple", "violet",}, {"red", "red",},
{"yellow", "yellow",}, {"white", "white",},
}
for _, item in pairs(recipe_list) do
local colour = item[1]
local ingredient = item[2]
minetest.register_craft({
output = "abritorch:torch_"..colour.." 4",
recipe = {
{"default:torch", "", "default:torch" },
{"", "dye:"..ingredient, "" },
{"default:torch", "", "default:torch" },
}
})
end
modname = "dye"
end
for i in ipairs(recipe_list) do
local colour = recipe_list[i][1]
local ingredient = recipe_list[i][2]
minetest.register_craft({
output = "abritorch:torch_"..colour.." 4",
recipe = {
{"default:torch", "", "default:torch" },
{"", modname..":"..ingredient, "" },
{"default:torch", "", "default:torch" },
}
})
end