This repository has been archived on 2024-12-09. You can view files and clone it, but cannot push or open issues or pull requests.
Mineclonia/mods/ITEMS/REDSTONE/mesecons/settings.lua

16 lines
445 B
Lua
Raw Normal View History

-- 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