Move protection into exp_scenario

The entity protection module moves to exp_scenario/module/control/protection.lua
in the event_handler shape the other control modules use, and the copy in
exp_legacy is removed. The config lookups are built as local sets instead of
rewriting the config tables in place, the two mined handlers become one, and
the entity and area key helpers are exposed so the protection command no
longer keeps its own copies. Event ids are exposed as
Protection.on_player_mined_protected and Protection.on_repeat_violation.
This commit is contained in:
bbassie
2026-09-05 19:19:45 +00:00
parent 810269971b
commit 0c52532c05
6 changed files with 247 additions and 228 deletions
@@ -5,7 +5,7 @@ When a player triggers protection multiple times they are automatically jailed
local ExpUtil = require("modules/exp_util")
local Storage = require("modules/exp_util/storage")
local Jail = require("modules.exp_legacy.modules.control.jail")
local Protection = require("modules.exp_legacy.modules.control.protection")
local Protection = require("modules/exp_scenario/control/protection")
local format_player_name = ExpUtil.format_player_name_locale
@@ -41,7 +41,7 @@ local e = defines.events
return {
events = {
[Protection.events.on_repeat_violation] = on_repeat_violation,
[Protection.on_repeat_violation] = on_repeat_violation,
[e.on_player_left_game] = on_player_left_game,
}
}