From d95ce4c703f3810d19107fef32389876e6e6060a Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Mon, 25 Feb 2019 19:10:19 +0100 Subject: [PATCH] spacesuit repair with air bottles --- depends.txt | 1 + init.lua | 1 + repair.lua | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 repair.lua diff --git a/depends.txt b/depends.txt index 585cc7a..3666bf9 100644 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1,3 @@ default 3d_armor +vacuum? diff --git a/init.lua b/init.lua index f86bd89..bb220e1 100644 --- a/init.lua +++ b/init.lua @@ -10,5 +10,6 @@ dofile(MP.."/suit.lua") dofile(MP.."/crafts.lua") dofile(MP.."/hud.lua") dofile(MP.."/drowning.lua") +dofile(MP.."/repair.lua") print("[OK] Spacesuit") diff --git a/repair.lua b/repair.lua new file mode 100644 index 0000000..1e66ccd --- /dev/null +++ b/repair.lua @@ -0,0 +1,23 @@ +local has_vacuum = minetest.get_modpath("vacuum") + +if has_vacuum then + + function repair_recipe(partname) + minetest.register_craft({ + type = "shapeless", + output = partname, + recipe = { + "vacuum:air_bottle", + partname + } + }) + end + + repair_recipe("spacesuit:helmet") + repair_recipe("spacesuit:chestplate") + repair_recipe("spacesuit:pants") + repair_recipe("spacesuit:boots") + + +end +