aboutsummaryrefslogtreecommitdiff
path: root/builtin/game/deprecated.lua
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-12-12 14:49:19 -0500
committerShadowNinja <shadowninja@minetest.net>2017-05-06 15:33:19 -0400
commit43d1f375d18a2fbc547a9b4f23d1354d645856ca (patch)
tree15de6977737b440b9d265f85dc1fe3c71e996a45 /builtin/game/deprecated.lua
parenta024042bf5ad487685e952da7b96ffa845cd7731 (diff)
downloadminetest-43d1f375d18a2fbc547a9b4f23d1354d645856ca.tar.gz
minetest-43d1f375d18a2fbc547a9b4f23d1354d645856ca.tar.bz2
minetest-43d1f375d18a2fbc547a9b4f23d1354d645856ca.zip
Use a settings object for the main settings
This unifies the settings APIs. This also unifies the sync and async registration APIs, since the async registration API did not support adding non-functions to the API table.
Diffstat (limited to 'builtin/game/deprecated.lua')
-rw-r--r--builtin/game/deprecated.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/builtin/game/deprecated.lua b/builtin/game/deprecated.lua
index cd1cf5e2d..1a9a96f2a 100644
--- a/builtin/game/deprecated.lua
+++ b/builtin/game/deprecated.lua
@@ -49,3 +49,24 @@ setmetatable(core.env, {
function core.rollback_get_last_node_actor(pos, range, seconds)
return core.rollback_get_node_actions(pos, range, seconds, 1)[1]
end
+
+--
+-- core.setting_*
+--
+
+local settings = core.settings
+
+local function setting_proxy(name)
+ return function(...)
+ core.log("deprecated", "WARNING: minetest.setting_* "..
+ "functions are deprecated. "..
+ "Use methods on the minetest.settings object.")
+ return settings[name](settings, ...)
+ end
+end
+
+core.setting_set = setting_proxy("set")
+core.setting_get = setting_proxy("get")
+core.setting_setbool = setting_proxy("set_bool")
+core.setting_getbool = setting_proxy("get_bool")
+core.setting_save = setting_proxy("write")