mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-08-21 13:34:11 +02:00
Replace deprecated methods:
- 'setting_get' with 'settings:get' - 'setting_getbool' with 'settings:get_bool'
This commit is contained in:
parent
d8f82e6771
commit
f70a308bb0
@ -1,15 +1,15 @@
|
|||||||
-- SETTINGS
|
-- SETTINGS
|
||||||
function mesecon.setting(setting, default)
|
function mesecon.setting(setting, default)
|
||||||
if type(default) == "boolean" then
|
if type(default) == "boolean" then
|
||||||
local read = minetest.setting_getbool("mesecon."..setting)
|
local read = minetest.settings:get_bool("mesecon."..setting)
|
||||||
if read == nil then
|
if read == nil then
|
||||||
return default
|
return default
|
||||||
else
|
else
|
||||||
return read
|
return read
|
||||||
end
|
end
|
||||||
elseif type(default) == "string" then
|
elseif type(default) == "string" then
|
||||||
return minetest.setting_get("mesecon."..setting) or default
|
return minetest.settings:get("mesecon."..setting) or default
|
||||||
elseif type(default) == "number" then
|
elseif type(default) == "number" then
|
||||||
return tonumber(minetest.setting_get("mesecon."..setting) or default)
|
return tonumber(minetest.settings:get("mesecon."..setting) or default)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user