mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
15 lines
445 B
Lua
15 lines
445 B
Lua
-- SETTINGS
|
|
function mesecon.setting(setting, default)
|
|
if type(default) == "boolean" then
|
|
local read = minetest.settings:get_bool("mesecon."..setting)
|
|
if read == nil then
|
|
return default
|
|
else
|
|
return read
|
|
end
|
|
elseif type(default) == "string" then
|
|
return minetest.settings:get("mesecon."..setting) or default
|
|
elseif type(default) == "number" then
|
|
return tonumber(minetest.settings:get("mesecon."..setting) or default)
|
|
end
|
|
end
|