init.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. local scriptpath = core.get_builtin_path()
  2. local commonpath = scriptpath .. "common" .. DIR_DELIM
  3. local gamepath = scriptpath .. "game".. DIR_DELIM
  4. -- Shared between builtin files, but
  5. -- not exposed to outer context
  6. local builtin_shared = {}
  7. dofile(gamepath .. "constants.lua")
  8. assert(loadfile(commonpath .. "item_s.lua"))(builtin_shared)
  9. assert(loadfile(gamepath .. "item.lua"))(builtin_shared)
  10. assert(loadfile(commonpath .. "register.lua"))(builtin_shared)
  11. assert(loadfile(gamepath .. "register.lua"))(builtin_shared)
  12. if core.settings:get_bool("profiler.load") then
  13. profiler = dofile(scriptpath .. "profiler" .. DIR_DELIM .. "init.lua")
  14. end
  15. dofile(commonpath .. "after.lua")
  16. dofile(commonpath .. "metatable.lua")
  17. dofile(commonpath .. "mod_storage.lua")
  18. dofile(gamepath .. "item_entity.lua")
  19. dofile(gamepath .. "deprecated.lua")
  20. dofile(gamepath .. "misc_s.lua")
  21. dofile(gamepath .. "misc.lua")
  22. dofile(gamepath .. "privileges.lua")
  23. dofile(gamepath .. "auth.lua")
  24. dofile(commonpath .. "chatcommands.lua")
  25. dofile(gamepath .. "chat.lua")
  26. dofile(commonpath .. "information_formspecs.lua")
  27. dofile(gamepath .. "static_spawn.lua")
  28. dofile(gamepath .. "detached_inventory.lua")
  29. assert(loadfile(gamepath .. "falling.lua"))(builtin_shared)
  30. dofile(gamepath .. "features.lua")
  31. dofile(gamepath .. "voxelarea.lua")
  32. dofile(gamepath .. "forceloading.lua")
  33. dofile(gamepath .. "hud.lua")
  34. dofile(gamepath .. "knockback.lua")
  35. dofile(gamepath .. "async.lua")
  36. dofile(gamepath .. "death_screen.lua")
  37. core.after(0, builtin_shared.cache_content_ids)
  38. profiler = nil