Skip to content

Make config.yml messages take effect - #5

Merged
MrPippi merged 1 commit into
mainfrom
cc/charming-keller-a0vyen
Oct 9, 2026
Merged

MrPippi merged 1 commit into
mainfrom
cc/charming-keller-a0vyen

Conversation

@MrPippi

@MrPippi MrPippi commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Summary

getMessage() only ever read lang.yml, so editing messages: in config.yml had no effect. Messages are now resolved by AutoPickupPlugin.resolveMessage(path, config, lang):

  1. config.yml, when the server's file sets the key to something other than the bundled default, or to a key the bundled config.yml doesn't have (for example messages.actionbar)
  2. otherwise lang.yml
  3. otherwise the bundled config.yml default

ActionBarManager resolves messages.actionbar and messages.actionbar-entry the same way, through getMessageTemplate().

Why compare against the bundled default instead of "config.yml always wins"

saveDefaultConfig() has already written every default message into existing servers' config.yml. If config.yml always won, those unedited copies would silently override anything an admin had customised in lang.yml. With this rule, edits in either file keep working. The one case that changes: if an admin had edited config.yml messages before (which did nothing until now), those edits start taking effect. The CHANGELOG upgrade notes call this out.

Other changes

  • Comments in config.yml and lang.yml explain the precedence.
  • README, CLAUDE.md and CHANGELOG are updated to match.
  • Fixed a stale javadoc in ActionBarManager, which referred to settings.actionbar-format.

Test plan

  • ./mvnw clean verify on JDK 25: 81 tests (73 existing + 8 new), 0 failures
  • The new AutoPickupPluginTest cases use the real bundled config.yml as defaults. They cover: edited config wins, an unedited default doesn't shadow lang.yml, a key missing from the file falls back to lang.yml, a key missing everywhere falls back to the bundled default, a config-only key wins, a lang-only key is used, and an unknown key resolves to null.
  • In-game: edit messages.toggled-on in config.yml, run /ap reload, then /ap shows the new text. Revert it and confirm a custom value in lang.yml is used instead.

🤖 Generated with Claude Code

https://claude.ai/code/session_018syaxkhsW9ioZChSmth9Xx


Generated by Claude Code

getMessage() only ever read lang.yml, so editing messages: in config.yml
did nothing. Messages are now resolved by AutoPickupPlugin.resolveMessage:

1. config.yml, when the server's file sets the key to something other
   than the bundled default (or a key with no bundled default)
2. otherwise lang.yml
3. otherwise the bundled config.yml default

Comparing against the bundled default keeps existing lang.yml
customisations working: saveDefaultConfig() already wrote every default
message into existing servers' config.yml, and those unedited copies must
not shadow lang.yml. ActionBarManager resolves messages.actionbar* the
same way.

Adds 8 tests for the precedence rules using the real bundled config.yml
as defaults. Docs, config.yml/lang.yml comments and CHANGELOG updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018syaxkhsW9ioZChSmth9Xx
@MrPippi
MrPippi marked this pull request as ready for review October 9, 2026 02:17
@MrPippi
MrPippi merged commit 29011fd into main Oct 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants