mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add ModStorageAPI to client side modding (#5396)
mod storage is located into user_path / client / mod_storage
This commit is contained in:
parent
46276414ed
commit
eb88e5dd4b
8 changed files with 68 additions and 11 deletions
|
@ -1,4 +1,5 @@
|
|||
local modname = core.get_current_modname() or "??"
|
||||
local modstorage = core.get_mod_storage()
|
||||
|
||||
-- This is an example function to ensure it's working properly, should be removed before merge
|
||||
core.register_on_shutdown(function()
|
||||
|
@ -49,6 +50,8 @@ core.register_chatcommand("test_node", {
|
|||
|
||||
core.after(2, function()
|
||||
print("[PREVIEW] loaded " .. modname .. " mod")
|
||||
modstorage:set_string("current_mod", modname)
|
||||
print(modstorage:get_string("current_mod"))
|
||||
end)
|
||||
|
||||
core.register_on_dignode(function(pos, node)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue