init.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. -----------------------------------------------------------------------------------------------
  2. local title = "Ferns" -- former "Archae Plantae"
  3. local version = "0.2.1"
  4. local mname = "ferns" -- former "archaeplantae"
  5. -----------------------------------------------------------------------------------------------
  6. -- (by Mossmanikin)
  7. -----------------------------------------------------------------------------------------------
  8. abstract_ferns = {}
  9. -- support for i18n
  10. local S = minetest.get_translator("ferns")
  11. dofile(minetest.get_modpath("ferns").."/settings.lua")
  12. if abstract_ferns.config.enable_lady_fern == true then
  13. dofile(minetest.get_modpath("ferns").."/fern.lua")
  14. end
  15. if abstract_ferns.config.enable_horsetails == true then
  16. dofile(minetest.get_modpath("ferns").."/horsetail.lua")
  17. end
  18. if abstract_ferns.config.enable_treefern == true then
  19. dofile(minetest.get_modpath("ferns").."/treefern.lua")
  20. end
  21. if abstract_ferns.config.enable_giant_treefern == true then
  22. dofile(minetest.get_modpath("ferns").."/gianttreefern.lua")
  23. end
  24. dofile(minetest.get_modpath("ferns").."/crafting.lua")
  25. -----------------------------------------------------------------------------
  26. -- TESTS
  27. -----------------------------------------------------------------------------
  28. local run_tests = true -- set to false to skip
  29. if run_tests then
  30. -- These are, essentially, unit tests to make sure that all required item
  31. -- strings are registered. The init sequence is not time critical so leaving
  32. -- them here won't affect performance.
  33. -- Check node names
  34. if abstract_ferns.config.enable_horsetails then
  35. print("[Mod] " ..title.. " Checking horsetail item strings")
  36. assert(minetest.registered_items["ferns:horsetail_01"] ~= nil)
  37. assert(minetest.registered_items["ferns:horsetail_02"] ~= nil)
  38. assert(minetest.registered_items["ferns:horsetail_03"] ~= nil)
  39. assert(minetest.registered_items["ferns:horsetail_04"] ~= nil)
  40. end
  41. if abstract_ferns.config.enable_lady_fern then
  42. print("[Mod] ".. title .." Checking lady fern item strings")
  43. assert(minetest.registered_items["ferns:fern_01"] ~= nil)
  44. assert(minetest.registered_items["ferns:fern_02"] ~= nil)
  45. assert(minetest.registered_items["ferns:fern_03"] ~= nil)
  46. end
  47. if abstract_ferns.config.enable_treefern then
  48. print("[Mod] ".. title .." Checking tree fern item strings")
  49. assert(minetest.registered_items["ferns:tree_fern_leaves"] ~= nil)
  50. assert(minetest.registered_items["ferns:tree_fern_leaves_02"] ~= nil)
  51. assert(minetest.registered_items["ferns:fern_trunk"] ~= nil)
  52. assert(minetest.registered_items["ferns:sapling_tree_fern"] ~= nil)
  53. end
  54. end
  55. -----------------------------------------------------------------------------------------------
  56. print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
  57. -----------------------------------------------------------------------------------------------