aboutsummaryrefslogtreecommitdiff
path: root/clientmods
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-03-16 07:53:39 +0100
committerGitHub <noreply@github.com>2017-03-16 07:53:39 +0100
commiteb88e5dd4b181a90b382c036cf6c4f42e63e8cc2 (patch)
tree2ba995e0a2f15c0bc50212169f0b5af8addd3f86 /clientmods
parent46276414ed51d61dc29879ac85e861dc770d90da (diff)
downloadminetest-eb88e5dd4b181a90b382c036cf6c4f42e63e8cc2.tar.gz
minetest-eb88e5dd4b181a90b382c036cf6c4f42e63e8cc2.tar.bz2
minetest-eb88e5dd4b181a90b382c036cf6c4f42e63e8cc2.zip
Add ModStorageAPI to client side modding (#5396)
mod storage is located into user_path / client / mod_storage
Diffstat (limited to 'clientmods')
-rw-r--r--clientmods/preview/init.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/clientmods/preview/init.lua b/clientmods/preview/init.lua
index 2ca4594d3..60dccf304 100644
--- a/clientmods/preview/init.lua
+++ b/clientmods/preview/init.lua
@@ -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)