#121 allow hot reloads on config#143
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements hot-reload behavior for marker-group configuration so that running /bluemap reload (BlueMap disable/enable cycle) refreshes the mod’s config-derived caches (config singleton, sign parser, and prefix→group resolution) without requiring a full server restart.
Changes:
- Add a reloadable
ConfigManagerand rebuildSignHelper’s cachedSignLinesParseron reload. - Refresh
SignManager’sprefixGroupMapandActionFactoryduring BlueMap reset, then replay the sign cache. - Harden
SignEntryHelper.isMarkerTypeagainst prefixes that no longer exist in config, and add a new unit test suite forSignEntryHelper.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/com/tpwalke2/bluemapsignmarkers/core/signs/SignEntryHelperTest.java | New unit tests covering SignEntryHelper behavior, including the “prefix removed from config” scenario. |
| src/main/java/com/tpwalke2/bluemapsignmarkers/core/signs/SignManager.java | Rebuild prefix→group map and action factory on reset to support config hot reload. |
| src/main/java/com/tpwalke2/bluemapsignmarkers/core/signs/SignHelper.java | Make the parser rebuildable to reflect updated marker groups after reload. |
| src/main/java/com/tpwalke2/bluemapsignmarkers/core/signs/SignEntryHelper.java | Add a null-guard when a prefix no longer resolves to a configured MarkerGroup. |
| src/main/java/com/tpwalke2/bluemapsignmarkers/core/bluemap/BlueMapAPIConnector.java | Minor ordering tweak in onEnable to assign blueMapAPI before processing/reset logic. |
| src/main/java/com/tpwalke2/bluemapsignmarkers/config/ConfigManager.java | Make the core config reference reloadable (volatile + reload()). |
| plans/marker-group-reload-followups-todo.md | New follow-up notes documenting deferred edge cases for marker-group reload. |
| plans/marker-group-config-reload-plan.md | New plan document describing the intended reload design and verification steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes marker-group config hot-reloadable: editing BMSM-Core.json and running /bluemap reload now picks up the new group definitions without a server restart.
Why
Config was previously frozen at class-init in three places (ConfigManager.coreConfig, SignHelper.signLinesParser, SignManager.prefixGroupMap), so a /bluemap reload already replayed the sign cache but with stale group data (old icons/offsets/visibility/distances). See plans/marker-group-config-reload-plan.md.
Changes
Testing