move "dye" to optional depends and disable recipes if default or dye are not available

This commit is contained in:
BuckarooBanzay 2021-08-15 11:10:53 +02:00
parent 85aa74e98b
commit 112543ca93
2 changed files with 32 additions and 11 deletions

View File

@ -1,14 +1,24 @@
-- CRAFTING RECIPES FOR SCIFI NODES
-- 6 basic plastic from 9 homedecor plastic sheet
minetest.register_craft({
output = "scifi_nodes:white2 6",
recipe = {
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"},
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"},
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"}
}
})
if minetest.get_modpath("basic_materials") then
-- 6 basic plastic from 9 homedecor plastic sheet
minetest.register_craft({
output = "scifi_nodes:white2 6",
recipe = {
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"},
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"},
{"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting"}
}
})
end
if not minetest.get_modpath("default") or not minetest.get_modpath("dye") then
-- the default and dye mod are required for most of the recipes
-- if either of them is missing (because we are not in the default game)
-- then just skip the recipes entirely
-- TODO: potentially switch recipes depending on current game
return
end
minetest.register_craft({
output = "scifi_nodes:super_white",

View File

@ -1,4 +1,15 @@
name = scifi_nodes
description = Minetest mod that adds scifi themed blocks, doors, materials, plants and other assets.
depends = default,dye
optional_depends = xpanes,mesecons,moreblocks,mesecons_microcontroller,mesecons_button,mesecons_torch,mesecons_receiver,basic_materials,unifieddyes
depends = default
optional_depends = """
xpanes,
mesecons,
moreblocks,
mesecons_microcontroller,
mesecons_button,
mesecons_torch,
mesecons_receiver,
basic_materials,
dye
unifieddyes
"""