Declare optional dependencies

This commit is contained in:
Wuzzy 2017-02-15 03:48:03 +01:00
parent 7047055fb6
commit b2c129984c
2 changed files with 30 additions and 26 deletions

@ -1,2 +1,3 @@
mesecons mesecons
doc doc?
default?

@ -170,31 +170,34 @@ minetest.register_node("mesecons_window:filter2_open", {
end end
}) })
if minetest.get_modpath("default") then
minetest.register_craft({
output = 'mesecons_window:window_closed',
recipe = {
{"", "default:glass", ""},
{"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"},
}
})
minetest.register_craft({ minetest.register_craft({
output = 'mesecons_window:window_closed', output = 'mesecons_window:filter_closed',
recipe = { recipe = {
{"", "default:glass", ""}, {"", "default:pine_needles", ""},
{"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"}, {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'mesecons_window:filter_closed', output = 'mesecons_window:filter2_closed',
recipe = { recipe = {
{"", "default:pine_needles", ""}, {"", "default:glass", ""},
{"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"}, {"default:pine_needles", "group:mesecon_conductor_craftable", "default:pine_needles"},
} }
}) })
end
minetest.register_craft({ if minetest.get_modpath("doc") then
output = 'mesecons_window:filter2_closed', doc.add_entry_alias("nodes", "mesecons_window:window_closed", "nodes", "mesecons_window:window_open")
recipe = { doc.add_entry_alias("nodes", "mesecons_window:filter_closed", "nodes", "mesecons_window:filter_open")
{"", "default:glass", ""}, doc.add_entry_alias("nodes", "mesecons_window:filter2_closed", "nodes", "mesecons_window:filter2_open")
{"default:pine_needles", "group:mesecon_conductor_craftable", "default:pine_needles"}, end
}
})
doc.add_entry_alias("nodes", "mesecons_window:window_closed", "nodes", "mesecons_window:window_open")
doc.add_entry_alias("nodes", "mesecons_window:filter_closed", "nodes", "mesecons_window:filter_open")
doc.add_entry_alias("nodes", "mesecons_window:filter2_closed", "nodes", "mesecons_window:filter2_open")