From e86c2e8ddf292ca3bb367f9e2347882de26ddf1f Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Sun, 18 Jun 2023 12:01:09 -0400 Subject: [PATCH] loading order fix, for correct spawning, added information files * add files for description and dependencies on modern engines * add dependencies info into README * use mod namespaced for detection of nnsm and tnt * add tnt and nssm as optional dependencies --- README.md | 6 ++++++ depends.txt | 3 ++- description.txt | 1 + init.lua | 17 ++++++++++++++--- mod.conf | 4 ++++ mushrooms.lua | 4 ++-- 6 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 description.txt create mode 100644 mod.conf diff --git a/README.md b/README.md index 291180d..5069965 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,12 @@ inactivate the toxin in poisonous fungi (only in some of them obviously!). In other cases cooking may damage the beneficial propreties of the mushrooms reducing their nutritional value. +#### Dependencies + +* default +* nssm (optional) +* tnt (optional) + #### ABMs Fungi are generated by ABM, so their growth will require some time. diff --git a/depends.txt b/depends.txt index 3a7daa1..7967081 100644 --- a/depends.txt +++ b/depends.txt @@ -1,2 +1,3 @@ default - +nssm? +tnt? diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..222f92f --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +NSSPF mod that adds wild plants (fungies) \ No newline at end of file diff --git a/init.lua b/init.lua index eaec95d..4dfc46e 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,15 @@ -local path = minetest.get_modpath("nsspf") +nsspf = {} +local mod = nsspf -dofile(path.."/spawn.lua") -dofile(path.."/mushrooms.lua") \ No newline at end of file +mod.version = '20230616' +mod.mod_name = minetest.get_current_modname() +mod.path = minetest.get_modpath(mod.mod_name) +mod.world = minetest.get_worldpath() +mod.nssm = minetest.get_modpath("nssm") +mod.tnt = minetest.get_modpath("tnt") +mod.dat = {} + +dofile(mod.path.."/mushrooms.lua") +dofile(mod.path.."/spawn.lua") + +print("[MOD] loaded nsspf") diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..aa19822 --- /dev/null +++ b/mod.conf @@ -0,0 +1,4 @@ +name = nsspf +depends = default +optional_depends = nssm, tnt +description = NSSPF mod that adds wild plants (fungies) diff --git a/mushrooms.lua b/mushrooms.lua index 9573d4c..e1b6f33 100644 --- a/mushrooms.lua +++ b/mushrooms.lua @@ -1690,7 +1690,7 @@ minetest.register_craft({ burntime = 120, }) -if minetest.get_modpath("nssm") then +if nsspf.nssm then minetest.register_craftitem("nsspf:long_lasting_amadou", { description = 'Long Lasting Amadou', @@ -1711,7 +1711,7 @@ if minetest.get_modpath("nssm") then end -if minetest.get_modpath("tnt") then +if nsspf.tnt then minetest.register_craftitem("nsspf:lasting_amadou", { description = 'Lasting Amadou',