mirror of
https://github.com/minetest-mods/areas.git
synced 2024-11-19 21:53:44 +01:00
Update usage of settings API
This commit is contained in:
parent
d3d43d9511
commit
289d0e623c
2
init.lua
2
init.lua
@ -32,7 +32,7 @@ if not minetest.registered_privileges[areas.config.self_protection_privilege] th
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.setting_getbool("log_mod") then
|
if minetest.settings:get_bool("log_mod") then
|
||||||
local diffTime = os.clock() - areas.startTime
|
local diffTime = os.clock() - areas.startTime
|
||||||
minetest.log("action", "areas loaded in "..diffTime.."s.")
|
minetest.log("action", "areas loaded in "..diffTime.."s.")
|
||||||
end
|
end
|
||||||
|
@ -6,13 +6,13 @@ local function setting(tp, name, default)
|
|||||||
local full_name = "areas."..name
|
local full_name = "areas."..name
|
||||||
local value
|
local value
|
||||||
if tp == "boolean" then
|
if tp == "boolean" then
|
||||||
value = minetest.setting_getbool(full_name)
|
value = minetest.settings:get_bool(full_name)
|
||||||
elseif tp == "string" then
|
elseif tp == "string" then
|
||||||
value = minetest.setting_get(full_name)
|
value = minetest.settings:get(full_name)
|
||||||
elseif tp == "position" then
|
elseif tp == "position" then
|
||||||
value = minetest.setting_get_pos(full_name)
|
value = minetest.setting_get_pos(full_name)
|
||||||
elseif tp == "number" then
|
elseif tp == "number" then
|
||||||
value = tonumber(minetest.setting_get(full_name))
|
value = tonumber(minetest.settings:get(full_name))
|
||||||
else
|
else
|
||||||
error("Invalid setting type!")
|
error("Invalid setting type!")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user