plantlife_modpack/ferns/init.lua

72 lines
2.8 KiB
Lua
Raw Normal View History

-----------------------------------------------------------------------------------------------
local title = "Ferns" -- former "Archae Plantae"
local version = "0.2.1"
local mname = "ferns" -- former "archaeplantae"
-----------------------------------------------------------------------------------------------
-- (by Mossmanikin)
-----------------------------------------------------------------------------------------------
2014-08-23 10:45:27 +02:00
abstract_ferns = {}
-- support for i18n
local S = minetest.get_translator("ferns")
dofile(minetest.get_modpath("ferns").."/settings.lua")
2014-08-22 09:04:34 +02:00
if abstract_ferns.config.enable_lady_fern == true then
2014-08-20 10:35:08 +02:00
dofile(minetest.get_modpath("ferns").."/fern.lua")
end
2014-08-22 09:04:34 +02:00
if abstract_ferns.config.enable_horsetails == true then
dofile(minetest.get_modpath("ferns").."/horsetail.lua")
end
2014-08-22 09:04:34 +02:00
if abstract_ferns.config.enable_treefern == true then
dofile(minetest.get_modpath("ferns").."/treefern.lua")
end
2014-08-22 09:04:34 +02:00
if abstract_ferns.config.enable_giant_treefern == true then
dofile(minetest.get_modpath("ferns").."/gianttreefern.lua")
end
dofile(minetest.get_modpath("ferns").."/crafting.lua")
2014-08-23 12:23:39 +02:00
-----------------------------------------------------------------------------
-- TESTS
-----------------------------------------------------------------------------
local run_tests = true -- set to false to skip
2014-08-23 10:45:27 +02:00
if run_tests then
2014-08-23 16:15:17 +02:00
-- These are, essentially, unit tests to make sure that all required item
-- strings are registered. The init sequence is not time critical so leaving
-- them here won't affect performance.
2014-08-23 10:45:27 +02:00
-- Check node names
2014-08-23 12:23:39 +02:00
if abstract_ferns.config.enable_horsetails then
print("[Mod] " ..title.. " Checking horsetail item strings")
2014-08-23 10:45:27 +02:00
assert(minetest.registered_items["ferns:horsetail_01"] ~= nil)
assert(minetest.registered_items["ferns:horsetail_02"] ~= nil)
assert(minetest.registered_items["ferns:horsetail_03"] ~= nil)
assert(minetest.registered_items["ferns:horsetail_04"] ~= nil)
end
2014-08-23 12:23:39 +02:00
if abstract_ferns.config.enable_lady_fern then
print("[Mod] ".. title .." Checking lady fern item strings")
assert(minetest.registered_items["ferns:fern_01"] ~= nil)
assert(minetest.registered_items["ferns:fern_02"] ~= nil)
assert(minetest.registered_items["ferns:fern_03"] ~= nil)
end
if abstract_ferns.config.enable_treefern then
print("[Mod] ".. title .." Checking tree fern item strings")
assert(minetest.registered_items["ferns:tree_fern_leaves"] ~= nil)
assert(minetest.registered_items["ferns:tree_fern_leaves_02"] ~= nil)
assert(minetest.registered_items["ferns:fern_trunk"] ~= nil)
assert(minetest.registered_items["ferns:sapling_tree_fern"] ~= nil)
end
2014-08-23 10:45:27 +02:00
end
-----------------------------------------------------------------------------------------------
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
-----------------------------------------------------------------------------------------------