xdecor-libre/init.lua

48 lines
1.3 KiB
Lua
Raw Normal View History

2015-12-18 17:36:12 +03:00
--local t = os.clock()
2018-03-09 02:24:00 +03:00
local mver_major, mver_minor, mver_patch = 0, 4, 16 -- Minetest 0.4.16 minimum.
local client_version = minetest.get_version().string
local major, minor, patch = client_version:match("(%d+).(%d+).(%d+)")
if (major and minor and patch) and
((tonumber(major) < mver_major) or
(mver_major == tonumber(major) and tonumber(minor) < mver_minor) or
(mver_minor == tonumber(minor) and tonumber(patch) < mver_patch)) then
minetest.log("error", "[xdecor] Your Minetest client is too old to run this mod. Disabling.")
return
end
2015-06-09 15:04:57 +03:00
xdecor = {}
2015-08-19 12:02:22 +03:00
local modpath = minetest.get_modpath("xdecor")
2015-06-09 15:04:57 +03:00
dofile(modpath.."/handlers/animations.lua")
2016-02-04 18:02:28 +03:00
dofile(modpath.."/handlers/helpers.lua")
2015-06-09 15:04:57 +03:00
dofile(modpath.."/handlers/nodeboxes.lua")
dofile(modpath.."/handlers/registration.lua")
dofile(modpath.."/src/alias.lua")
dofile(modpath.."/src/nodes.lua")
dofile(modpath.."/src/recipes.lua")
2018-03-08 23:12:21 +03:00
local subpart = {
"chess",
"cooking",
"enchanting",
"hive",
"itemframe",
"mailbox",
"mechanisms",
"rope",
"workbench"
}
2018-03-08 23:12:21 +03:00
for _, name in pairs(subpart) do
local enable = minetest.settings:get_bool("enable_xdecor_"..name)
if enable or enable == nil then
dofile(modpath.."/src/"..name..".lua")
end
end
--print(string.format("[xdecor] loaded in %.2f ms", (os.clock()-t)*1000))