Keeps regenerating "broken" config
artemisSystem opened this issue · 3 comments
I constantly get this warning in the log: "Configuration file <my_instance>/config/itemborders-common.toml
is not correct. Correcting"
But the "correcting" doesn't actually do anything, and ends up spitting out another config file that's exactly the same and still broken, according to the mod. This ends up both spamming the log, and generating 5 backup config files.
This also keeps happening if i delete all the junk configs.
I am on macOS. if this does not happen on windows i suspect it's related to /
vs \
file separators.
Thanks for this simple solution @murphy-slaw 😄
I think I figured this out!
The default config does not include a key for [client.options.manual_borders]
.
So when ForgeConfigApiPortConfig.loadFrom() calls NightConfig's ConfigSpec.isCorrect(), it thinks the config is invalid due to a missing key. Then it tries ConfigSpec.correct(), but manual_borders has no default value, so it leaves the config unchanged, and saves it. Then it tries to load it again, and the same thing happens, over and over again.
This doesn't occur if the config has a value for manual_borders.
Perhaps add a default value for manual borders like this?
[client.options.manual_borders]
red = []
Which does nothing because there are no selectors, but does satisfy the config validator that the key exists.