mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Content ID caching in Lua (#12444)
* Cache content IDs in Lua Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
006d974c58
commit
310b12b5ed
6 changed files with 166 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue