1
0
mirror of https://github.com/HybridDog/nether-pack.git synced 2024-12-26 18:50:24 +01:00
nether-pack/nether/settings.lua
HybridDog 817efcdd29 Add settingtypes.txt to configure player trapping and message logging
There are also some changes to fix problems when trapping is enabled while damage is disabled or the other way round.
2022-08-16 17:25:41 +02:00

24 lines
533 B
Lua

local default_settings = {
trap_players = true,
log_to_chat = false,
log_level = 2,
}
nether.settings = {}
for name,dv in pairs(default_settings) do
local setting
local setting_name = "nether." .. name
if type(dv) == "boolean" then
setting = minetest.settings:get_bool(setting_name)
elseif type(dv) == "number" then
setting = tonumber(minetest.settings:get(setting_name))
else
error"[nether] Only boolean and number settings are available"
end
if setting == nil then
setting = dv
end
nether[name] = setting
end