dofile(modpath.."/handlers/nodeboxes.lua")
dofile(modpath.."/handlers/registration.lua")
--- Item files.
-dofile(modpath.."/chess.lua")
-dofile(modpath.."/cooking.lua")
-dofile(modpath.."/craftguide.lua")
-dofile(modpath.."/craftitems.lua")
-dofile(modpath.."/enchanting.lua")
-dofile(modpath.."/hive.lua")
-dofile(modpath.."/itemframe.lua")
-dofile(modpath.."/mailbox.lua")
-dofile(modpath.."/mechanisms.lua")
-dofile(modpath.."/nodes.lua")
-dofile(modpath.."/recipes.lua")
-dofile(modpath.."/rope.lua")
-dofile(modpath.."/workbench.lua")
---print(string.format("[xdecor] loaded in %.2f ms", (os.clock()-t)*1000))
+-- Node and others
+dofile(modpath.."/src/alias.lua")
+dofile(modpath.."/src/nodes.lua")
+dofile(modpath.."/src/recipes.lua")
+
+-- Elements
+local submod = {
+ "chess",
+ "cooking",
+ "enchanting",
+ "hive",
+ "itemframe",
+ "mailbox",
+ "mechanisms",
+ "rope",
+ "workbench"
+}
+
+for _, name in ipairs(submod) do
+ local enable = not(minetest.settings:get_bool("disable_xdecor_"..name))
+ if enable then
+ dofile(modpath.."/src/"..name..".lua")
+ end
+end
+
+--print(string.format("[xdecor] loaded in %.2f ms", (os.clock()-t)*1000))