From b5205e4e7d651306d31e2ea100ad75abb1856401 Mon Sep 17 00:00:00 2001 From: Buckaroo Banzai <39065740+BuckarooBanzay@users.noreply.github.com> Date: Tue, 2 Nov 2021 19:45:07 +0100 Subject: [PATCH] opt-depend on default [squash] (#9) * more detailed dep checks for recipes * remove (opt-) depends on default Co-authored-by: BuckarooBanzay --- depends.txt | 1 - init.lua | 35 ++++++++++++++++++++--------------- 2 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 depends.txt diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 4ad96d5..0000000 --- a/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default diff --git a/init.lua b/init.lua index 955213d..ce304af 100644 --- a/init.lua +++ b/init.lua @@ -76,19 +76,24 @@ minetest.register_node("jumping:cushion", { groups = {dig_immediate=2, disable_jump=1, fall_damage_add_percent=-100}, }) -minetest.register_craft({ - output = "jumping:trampoline1", - recipe = { - {"jumping:cushion", "jumping:cushion", "jumping:cushion"}, - {"default:steel_ingot", "", "default:steel_ingot"} - } -}) +-- register recipes if the corresponding mods are present +if minetest.get_modpath("default") then + minetest.register_craft({ + output = "jumping:trampoline1", + recipe = { + {"jumping:cushion", "jumping:cushion", "jumping:cushion"}, + {"default:steel_ingot", "", "default:steel_ingot"} + } + }) +end -minetest.register_craft({ - output = "jumping:cushion", - recipe = { - {"farming:cotton", "group:wool", "farming:cotton"}, - {"farming:cotton", "group:wool", "farming:cotton"}, - {"farming:cotton", "farming:cotton", "farming:cotton"} - } -}) +if minetest.get_modpath("farming") and minetest.get_modpath("wool") then + minetest.register_craft({ + output = "jumping:cushion", + recipe = { + {"farming:cotton", "group:wool", "farming:cotton"}, + {"farming:cotton", "group:wool", "farming:cotton"}, + {"farming:cotton", "farming:cotton", "farming:cotton"} + } + }) +end \ No newline at end of file