Address the second inline review of the features framework

- Feature.register returns the config as a second value, so files
  write `local feature, config = Feature.register(...)`.
- The lib is ExpScenario.Features and the instance class with its
  fields sits on Feature._prototype, which is the __index, the same
  shape as exp_commands.
- update_config only looks at values whose override was added,
  removed, or replaced. _apply_field sets one value and returns it, so
  the comparison happens while applying and the second loop only
  raises. Overrides dropped from the previous set count as candidates
  because the value reverts to its default.
- The `@setting name` tags are gone from the config comments.
- Protection is guarded as a whole instead of checking config.enabled
  in one handler. The handlers also forget mined entities, so
  get_entities and is_entity_protected now drop invalid references,
  which also covers entities destroyed without an event. The list
  getters are gone, the selection overlay builds its lists from
  Protection.config.
- Chat and damage popups are one feature in control/popups.lua.
- ignore_admins and command_admin_only are removed, roles cover them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Fable 5.1 committed 2026-10-03 07:35:58 +00:00
1 parent bff6a1c612
commit f90b8fcee1
21 files changed
+289 -286

No files matched your search

-3
View File
@@ -86,7 +86,6 @@ export const features: Feature[] = [
description: "Reply to key words in chat and run chat commands",
fields: [
str("command_prefix", "Command prefix", "Prefix for chat commands, and for key words to reply to everyone", "!"),
bool("command_admin_only", "Commands for admins only", "Only admins can use chat commands", false),
],
},
{
@@ -142,7 +141,6 @@ export const features: Feature[] = [
title: "Nuke Protection",
description: "Remove banned items from players without the nuke protection bypass permission",
fields: [
bool("ignore_admins", "Ignore admins", "Admins can hold banned items", true),
list("banned_items", "Banned items", "Items which are moved to a chest at spawn", ["atomic-bomb"]),
],
},
@@ -163,7 +161,6 @@ export const features: Feature[] = [
title: "Entity Protection",
description: "Stop players removing protected entities placed by others, players with the bypass permission are ignored",
fields: [
bool("ignore_admins", "Ignore admins", "Admins can remove protected entities", true),
num("repeat_count", "Repeat count", "Protected entities removed within the repeat time which count as a repeat violation", 5, 1),
num("repeat_minutes", "Repeat time", "How long removed protected entities are remembered", 20, 1, "minutes"),
list("always_protected_names", "Protected entity names", "Entities which are always protected", []),