diff options
author | Jude Melton-Houghton <jwmhjwmh@gmail.com> | 2022-09-18 11:46:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-18 17:46:48 +0200 |
commit | 310b12b5edaaa415e664a7766b9226fc95ce89e4 (patch) | |
tree | fcea11433f6407d692cdcef7e2f934335b0d2d62 /builtin/async/game.lua | |
parent | 006d974c584933dc4482c4a1b05f6bc0c249c8e0 (diff) | |
download | minetest-310b12b5edaaa415e664a7766b9226fc95ce89e4.tar.xz |
Content ID caching in Lua (#12444)
* Cache content IDs in Lua
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'builtin/async/game.lua')
-rw-r--r-- | builtin/async/game.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/async/game.lua b/builtin/async/game.lua index 6512f0706..0b7a7ef0e 100644 --- a/builtin/async/game.lua +++ b/builtin/async/game.lua @@ -13,9 +13,12 @@ end -- Import a bunch of individual files from builtin/game/ local gamepath = core.get_builtin_path() .. "game" .. DIR_DELIM +local commonpath = core.get_builtin_path() .. "common" .. DIR_DELIM + +local builtin_shared = {} dofile(gamepath .. "constants.lua") -dofile(gamepath .. "item_s.lua") +assert(loadfile(commonpath .. "item_s.lua"))(builtin_shared) dofile(gamepath .. "misc_s.lua") dofile(gamepath .. "features.lua") dofile(gamepath .. "voxelarea.lua") @@ -57,3 +60,5 @@ setmetatable(core.registered_items, alias_metatable) setmetatable(core.registered_nodes, alias_metatable) setmetatable(core.registered_craftitems, alias_metatable) setmetatable(core.registered_tools, alias_metatable) + +builtin_shared.cache_content_ids() |