From 61c001b6cae6377f1baf7279fa45edd84ed43bba Mon Sep 17 00:00:00 2001 From: Michael Gilardi <11632652+mgilardi@users.noreply.github.com> Date: Tue, 17 Nov 2026 03:11:09 -0700 Subject: [PATCH] Stop warning that mask-for-viewers isn't a setting (0.6.1) 0.6.0 read and used mask-for-viewers, but the list of known filter.yml keys missed it, so every start logged a false warning. The settings test now checks the key raises no warning. Unit tests only; not run live. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 5 +++++ build.gradle.kts | 2 +- src/main/java/com/extantape/mayor/config/SettingsLoader.java | 2 +- .../java/com/extantape/mayor/config/SettingsLoaderTest.java | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6c1b12..aedfb47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.6.1 + +- `mask-for-viewers` no longer gets a warning at start-up saying it isn't a setting. 0.6.0 read and used it all along; only the list of known settings missed it. +- Tested: unit tests, including a check that the setting raises no warning. Not run on a live server. + ## 0.6.0 - **Adults' words masked for kids** (D233, D235). A new `mask-for-viewers` setting in `filter.yml`, off by default. With it on, a player with `mayor.filter.bypass` writes freely, and anyone without the bypass sees each blocked word as `****` in that player's chat and private messages, while players with the bypass see them as written. A player without the bypass counts as filtered, so one whose permissions aren't known yet is filtered too. diff --git a/build.gradle.kts b/build.gradle.kts index 7f86ac7..5366b0a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } group = "com.extantape" -version = "0.6.0" +version = "0.6.1" java { toolchain.languageVersion.set(JavaLanguageVersion.of(25)) diff --git a/src/main/java/com/extantape/mayor/config/SettingsLoader.java b/src/main/java/com/extantape/mayor/config/SettingsLoader.java index bd4748b..ad267f3 100644 --- a/src/main/java/com/extantape/mayor/config/SettingsLoader.java +++ b/src/main/java/com/extantape/mayor/config/SettingsLoader.java @@ -34,7 +34,7 @@ public final class SettingsLoader { private static final Set CONFIG_KEYS = Set.of("config-version", "circles", "circle-only-worlds", "world-groups", "dimension-suffixes", "private-message-commands", "reply-commands", "broadcast-commands", "blocked-commands", "nobody-heard", "messages"); - private static final Set FILTER_KEYS = Set.of("enabled", "check", "words", "allow"); + private static final Set FILTER_KEYS = Set.of("enabled", "check", "words", "allow", "mask-for-viewers"); /** The result: settings to apply, or errors explaining why there are none. Warnings either way. */ public record Result(Settings settings, List errors, List warnings) { diff --git a/src/test/java/com/extantape/mayor/config/SettingsLoaderTest.java b/src/test/java/com/extantape/mayor/config/SettingsLoaderTest.java index 25e21d6..d0088aa 100644 --- a/src/test/java/com/extantape/mayor/config/SettingsLoaderTest.java +++ b/src/test/java/com/extantape/mayor/config/SettingsLoaderTest.java @@ -81,5 +81,6 @@ void maskForViewersIsOffByDefaultAndReadFromFilterYml() { SettingsLoader.Result on = load(null, "words: [heck]\nmask-for-viewers: true\n", null); assertTrue(on.ok(), on.errors().toString()); assertTrue(on.settings().filtered().maskForViewers()); + assertTrue(on.warnings().isEmpty(), on.warnings().toString()); } }