minetest-cavereams/config.lua

25 lines
660 B
Lua
Raw Normal View History

local CONFIG_FILE_PREFIX = "caverealms."
caverealms.config = {}
-- This function based on kaeza/minetest-irc/config.lua and used under the
-- terms of BSD 2-clause license.
local function setting(stype, name, default)
local value
if stype == "bool" then
value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name)
elseif stype == "string" then
value = minetest.setting_get(CONFIG_FILE_PREFIX..name)
elseif stype == "number" then
value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name))
end
if value == nil then
value = default
end
caverealms.config[name] = value
end
setting("number", "ymin", -33000)
setting("number", "ymax", -700)