settings.lua 385 B

1234567891011
  1. -- SETTINGS
  2. function mesecon.setting(setting, default)
  3. if type(default) == "bool" then
  4. return minetest.setting_getbool("mesecon."..setting) or default
  5. elseif type(default) == "string" then
  6. return minetest.setting_get("mesecon."..setting) or default
  7. elseif type(default) == "number" then
  8. return tonumber(minetest.setting_get("mesecon."..setting) or default)
  9. end
  10. end