Tidy up recipes
parent
931a29427c
commit
ccc6627bf3
42
crafting.lua
42
crafting.lua
|
@ -1,55 +1,39 @@
|
||||||
|
|
||||||
|
local recipe_list
|
||||||
|
local modname
|
||||||
|
|
||||||
-- recipes when caverealms is present
|
-- recipes when caverealms is present
|
||||||
if minetest.get_modpath("caverealms") then
|
if minetest.get_modpath("caverealms") then
|
||||||
|
recipe_list = {
|
||||||
local recipe_list = {
|
|
||||||
{"black", "spike",}, {"blue", "glow_crystal",},
|
{"black", "spike",}, {"blue", "glow_crystal",},
|
||||||
{"cyan", "glow_gem",}, {"green", "glow_emerald",},
|
{"cyan", "glow_gem",}, {"green", "glow_emerald",},
|
||||||
{"magenta", "salt_gem",}, {"orange", "fire_vine",},
|
{"magenta", "salt_gem",}, {"orange", "fire_vine",},
|
||||||
{"purple", "glow_amethyst",}, {"red", "glow_ruby",},
|
{"purple", "glow_amethyst",}, {"red", "glow_ruby",},
|
||||||
{"yellow", "glow_mese",}, {"white", "glow_ore",},
|
{"yellow", "glow_mese",}, {"white", "glow_ore",},
|
||||||
}
|
}
|
||||||
|
modname = "caverealms"
|
||||||
for _, item in pairs(recipe_list) do
|
-- recipes when caverealms not present
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
else
|
else
|
||||||
-- recipes when caverealms not present
|
recipe_list = {
|
||||||
|
|
||||||
local recipe_list = {
|
|
||||||
{"black", "black",}, {"blue", "blue",},
|
{"black", "black",}, {"blue", "blue",},
|
||||||
{"cyan", "cyan",}, {"green", "green",},
|
{"cyan", "cyan",}, {"green", "green",},
|
||||||
{"magenta", "magenta",}, {"orange", "orange",},
|
{"magenta", "magenta",}, {"orange", "orange",},
|
||||||
{"purple", "violet",}, {"red", "red",},
|
{"purple", "violet",}, {"red", "red",},
|
||||||
{"yellow", "yellow",}, {"white", "white",},
|
{"yellow", "yellow",}, {"white", "white",},
|
||||||
}
|
}
|
||||||
|
modname = "dye"
|
||||||
|
end
|
||||||
|
|
||||||
for _, item in pairs(recipe_list) do
|
for i in ipairs(recipe_list) do
|
||||||
|
local colour = recipe_list[i][1]
|
||||||
local colour = item[1]
|
local ingredient = recipe_list[i][2]
|
||||||
local ingredient = item[2]
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "abritorch:torch_"..colour.." 4",
|
output = "abritorch:torch_"..colour.." 4",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:torch", "", "default:torch" },
|
{"default:torch", "", "default:torch" },
|
||||||
{"", "dye:"..ingredient, "" },
|
{"", modname..":"..ingredient, "" },
|
||||||
{"default:torch", "", "default:torch" },
|
{"default:torch", "", "default:torch" },
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue