Repository navigation
Use SyntaxCore ConfigManager for PlotsX startup and reload - #29
Merged
Merged
Conversation
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.
PlotsX previously filled missing configuration fields manually and kept a stale Bukkit view after writing the file. Startup now uses SyntaxCore.init(this), assigns SyntaxCore.logger, and loads the main YAML through ConfigManager before plot/database services initialize. Successful loading refreshes Bukkit's config and pluginConfig; /ptx reload follows the same path while retaining the claim-mode restart guard.
The bundled schema advances to 103 with steps 100 → 101 → 102 → 103. Migration preserves raw user values, including unknown nested maps/lists, while adding missing defaults. Database selections and credentials are retained. Language completion remains separate and now uses strict parsing: malformed YAML cannot become an empty configuration which is then overwritten with defaults. Reload prevalidation also uses strict parsing. Runtime/compile coordinates use SyntaxCore 2.0.0-R0.1-SNAPSHOT; teardown explicitly closes core.
Validation: full test/build passed, 217 tests with zero failures and zero skips. Twelve configuration tests include parameterized loops covering:
Consumer tests invoke the resolved SyntaxCore file engine reflectively to exercise the actual loader without a live JavaPlugin or new mocking dependency. Verified packaged schema 103 and runtime core coordinates. Live server smoke tests were not run.
Backup is once per migration attempt/chain, not per individual version step. Parsing precedes backup/mutation; parse failure leaves the original intact. Current/future schemas are read without rewriting, adding missing fields on disk, or creating migration backups. Documentation explains these boundaries and startup-only settings.