mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Add setting to disable events
This commit is contained in:
parent
a1e21b44c8
commit
2147790b44
2 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
||||||
mcl_events = {}
|
mcl_events = {}
|
||||||
mcl_events.registered_events = {}
|
mcl_events.registered_events = {}
|
||||||
|
local disabled_events = minetest.settings:get("mcl_disabled_events")
|
||||||
|
if disabled_events then disabled_events = disabled_events:split(",")
|
||||||
|
else disabled_events = {} end
|
||||||
local DBG = minetest.settings:get_bool("mcl_logging_event_api",false)
|
local DBG = minetest.settings:get_bool("mcl_logging_event_api",false)
|
||||||
local active_events = {}
|
local active_events = {}
|
||||||
|
|
||||||
|
@ -27,6 +30,7 @@ local function mcl_log(m,l)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_events.register_event(name,def)
|
function mcl_events.register_event(name,def)
|
||||||
|
if table.indexof(disabled_events,name) ~= -1 then return end
|
||||||
mcl_events.registered_events[name] = {}
|
mcl_events.registered_events[name] = {}
|
||||||
--setmetatable(mcl_events.registered_events[name],tpl_eventdef)
|
--setmetatable(mcl_events.registered_events[name],tpl_eventdef)
|
||||||
mcl_events.registered_events[name] = def
|
mcl_events.registered_events[name] = def
|
||||||
|
|
|
@ -42,6 +42,9 @@ mcl_tnt_griefing (TNT destroys blocks) bool true
|
||||||
# Comma separated list of disabled structure names
|
# Comma separated list of disabled structure names
|
||||||
mcl_disabled_structures (Disabled structures) string
|
mcl_disabled_structures (Disabled structures) string
|
||||||
|
|
||||||
|
# Comma separated list of disabled event names
|
||||||
|
mcl_disabled_events (Disabled events) string
|
||||||
|
|
||||||
[Players]
|
[Players]
|
||||||
# If enabled, players respawn at the bed they last lay on instead of normal
|
# If enabled, players respawn at the bed they last lay on instead of normal
|
||||||
# spawn.
|
# spawn.
|
||||||
|
|
Loading…
Reference in a new issue