Auto remove dead config categories/values from the config file #78
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.
Any config values that are no longer in use will stay indefinitely in the config file and also shows up in the config gui.
Take this old boubou test config for instance
Anything that doesn't have a comment above it is dead i.e no longer in use. This can easily confuse players and that confusion is heightened when the gui shows something like this
Only the highlighted value is still active the other 4 are just dead weight, but the player can't be expected to know that.
This pr automatically gets rid of all those unnecessary values/categories, it only adds a tiny amount of overhead for configs that don't need to have anything removed as it only ends up being a size comparison for them.
The
init
method has also been moved into a static block as that works perfectly fine even for mods like Hodgepodge that register its configs very early in coremod.That old config gets slimmed down to this afterwards