From bace2c1686ca9c4e9fb2118d8a24d85a1902e0b2 Mon Sep 17 00:00:00 2001 From: Nathan Fritzler Date: Wed, 26 Jan 2022 13:16:46 -0700 Subject: [PATCH] Add ediblestuff_api as an optional dependancy. This will allow players to eat chocolate, waffle, and candycane armor, even while wearing it, if ediblestuff_api is present --- init.lua | 4 ++++ make_edible.lua | 11 +++++++++++ mod.conf | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 make_edible.lua diff --git a/init.lua b/init.lua index 3a9b415..3af11a9 100644 --- a/init.lua +++ b/init.lua @@ -10,3 +10,7 @@ moarmour = { dofile(moarmour_path.."/nodes.lua") dofile(moarmour_path.."/crafts.lua") dofile(moarmour_path.."/armour.lua") +-- Optional mod-specific stuff -- +if minetest.get_modpath("ediblestuff_api") then + dofile(moarmour_path.."/make_edible.lua") +end diff --git a/make_edible.lua b/make_edible.lua new file mode 100644 index 0000000..04d8d39 --- /dev/null +++ b/make_edible.lua @@ -0,0 +1,11 @@ +if minetest.get_modpath("waffles") then + -- A waffle block is 9 waffles, 8 stamina each. This is huge. + -- Let's just do 20 for all waffle armor peices. + ediblestuff.make_armor_edible_while_wearing("moarmour","waffle",20,true) +end +if minetest.get_modpath("farming") and farming.mod == "redo" then + ediblestuff.make_armor_edible_while_wearing("moarmour","chocolate",2.5) +end +if minetest.get_modpath("candycane") then + ediblestuff.make_armor_edible_while_wearing("moarmour","cane",3.5) +end diff --git a/mod.conf b/mod.conf index 9aaba1a..d2d78cf 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = moarmour description = Additional armors to build and wear depends = default,3d_armor -optional_depends = nyancats_plus,waffles,farming,nanotech,even_mosword,candycane,moreores,bones,bonemeal,xpanes,tac_nayn,sky_tools,emeralds,gems,terumet +optional_depends = nyancats_plus,waffles,farming,nanotech,even_mosword,candycane,moreores,bones,bonemeal,xpanes,tac_nayn,sky_tools,emeralds,gems,terumet,ediblestuff_api