16 lines
445 B
Lua
Raw Normal View History

2016-04-01 22:10:20 -04:00
-- SETTINGS
function mesecon.setting(setting, default)
if type(default) == "boolean" then
local read = minetest.settings:get_bool("mesecon."..setting)
2016-04-01 22:10:20 -04:00
if read == nil then
return default
else
return read
end
elseif type(default) == "string" then
return minetest.settings:get("mesecon."..setting) or default
2016-04-01 22:10:20 -04:00
elseif type(default) == "number" then
return tonumber(minetest.settings:get("mesecon."..setting) or default)
2016-04-01 22:10:20 -04:00
end
end