]> git.lizzy.rs Git - xdecor.git/blob - init.lua
Add mesecons support to doors (#106)
[xdecor.git] / init.lua
1 --local t = os.clock()
2
3 local mver_major, mver_minor, mver_patch = 0, 4, 16 -- Minetest 0.4.16 minimum.
4
5 local client_version = minetest.get_version().string
6 local major, minor, patch = client_version:match("(%d+).(%d+).(%d+)")
7
8 if (major and minor and patch)     and
9    ((tonumber(major) < mver_major) or
10     (mver_major == tonumber(major) and tonumber(minor) < mver_minor)  or
11     (mver_minor == tonumber(minor) and tonumber(patch) < mver_patch)) then
12         minetest.log("error", "[xdecor] Your Minetest client is too old to run this mod. Disabling.")
13         return
14 end
15
16 xdecor = {}
17 local modpath = minetest.get_modpath("xdecor")
18
19 dofile(modpath.."/handlers/animations.lua")
20 dofile(modpath.."/handlers/helpers.lua")
21 dofile(modpath.."/handlers/nodeboxes.lua")
22 dofile(modpath.."/handlers/registration.lua")
23
24 dofile(modpath.."/src/alias.lua")
25 dofile(modpath.."/src/nodes.lua")
26 dofile(modpath.."/src/recipes.lua")
27
28 local subpart = {
29         "chess",
30         "cooking",
31         "enchanting",
32         "hive",
33         "itemframe",
34         "mailbox",
35         "mechanisms",
36         "rope",
37         "workbench"
38 }
39
40 for _, name in pairs(subpart) do
41         local enable = minetest.settings:get_bool("enable_xdecor_"..name)
42         if enable or enable == nil then
43                 dofile(modpath.."/src/"..name..".lua")
44         end
45 end
46
47 --print(string.format("[xdecor] loaded in %.2f ms", (os.clock()-t)*1000))