X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=init.lua;h=1399a1c69cb5346a9eb54c3f4779885c7ce58d3b;hb=61d9da63fad0f8de2ffdce688c0653c49e79a292;hp=629daee3e4d58c7dabc480cc2ab6f9dd7e8c1c35;hpb=6bd045e3de0988c08a5831e2b84fa763925afd65;p=xdecor.git diff --git a/init.lua b/init.lua index 629daee..1399a1c 100644 --- a/init.lua +++ b/init.lua @@ -1,24 +1,33 @@ --local t = os.clock() + xdecor = {} local modpath = minetest.get_modpath("xdecor") --- Handlers. -dofile(modpath.."/handlers/animations.lua") -dofile(modpath.."/handlers/helpers.lua") -dofile(modpath.."/handlers/nodeboxes.lua") -dofile(modpath.."/handlers/registration.lua") +dofile(modpath .. "/handlers/animations.lua") +dofile(modpath .. "/handlers/helpers.lua") +dofile(modpath .. "/handlers/nodeboxes.lua") +dofile(modpath .. "/handlers/registration.lua") + +dofile(modpath .. "/src/nodes.lua") +dofile(modpath .. "/src/recipes.lua") + +local subpart = { + "chess", + "cooking", + "enchanting", + "hive", + "itemframe", + "mailbox", + "mechanisms", + "rope", + "workbench", +} + +for _, name in ipairs(subpart) do + local enable = minetest.settings:get_bool("enable_xdecor_" .. name) + if enable or enable == nil then + dofile(modpath .. "/src/" .. name .. ".lua") + end +end --- Item files. -dofile(modpath.."/src/chess.lua") -dofile(modpath.."/src/cooking.lua") -dofile(modpath.."/src/craftitems.lua") -dofile(modpath.."/src/enchanting.lua") -dofile(modpath.."/src/hive.lua") -dofile(modpath.."/src/itemframe.lua") -dofile(modpath.."/src/mailbox.lua") -dofile(modpath.."/src/mechanisms.lua") -dofile(modpath.."/src/nodes.lua") -dofile(modpath.."/src/recipes.lua") -dofile(modpath.."/src/rope.lua") -dofile(modpath.."/src/workbench.lua") --print(string.format("[xdecor] loaded in %.2f ms", (os.clock()-t)*1000))