refactor: Rewrite config using Night-Config (TOML)#9
Open
ZephByte wants to merge 6 commits into
Open
Conversation
ZephByte
force-pushed
the
config-updates
branch
from
October 27, 2025 00:38
f2bf70e to
45ede77
Compare
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.
This MR completely overhauls the mod's configuration system by replacing the manual
.propertiesfile implementation with the powerful Night-Config library, using the TOML format.This change significantly improves the maintainability, readability, and robustness of the configuration management.
Key Changes
Switched to Night-Config:
com.electronwill.night-config:tomldependency.config/ScaledDragonFight.toml, which is more structured and user-friendly than a properties file.Complete
ConfigManager.ktRewrite:ConfigManagerobject, which was responsible for manual file I/O, parsing, and default value handling, has been replaced with a modern, type-safe, and declarative system.SDFConfig, provides structured, read-only access to all configuration values (e.g.,SDFConfig.healthScaling.baseDragonHealth).general,healthScaling,spawnDelay, etc.) for better organization.define) is used to reduce boilerplate, automatically handle default values, and generate comments in the config file.Codebase-wide Refactoring:
ConfigManagerhave been updated to use the newSDFConfigobject. This includesDragonScaler,DragonEventHandler, andModCommands.New Configuration Options:
Benefits of this Change