Config always resets to default upon restart
Slimerblue22 opened this issue ยท 9 comments
What version of the mod are you using? Please include a full version number. 1.0.5 is where I first saw the issue, though it also occurs in 1.0.6.
What mod loader did you use? Minecraft 1.20.2 with Fabric.
Did you use any other mods? Usually I use https://modrinth.com/modpack/fabulously-optimized but the issue also occurs with only Wynntils.
What operating system are you using? Windows 10.
What did you do? Changed config options, doesn't seem to matter which ones. For quick testing I changed the GUI scale from 2 to 3.
What did you expect to see? The config options to change and stay changed upon restart.
What did you see instead? The config options reset to default upon restart with the following error and related log.
[Render thread/ERROR]: Illegal option value for translation{key='options.audioDevice', args=[]}
[Render thread/INFO]: Creating default config file with 780 config values.
I have confirmed this issue only occurs with Wynntils installed and I can not get it to occur without Wynntils. This link https://mclo.gs/IFyeYzm shows the entire log file from the moment the game begins booting up to the moment the menu is loaded and the error occurs. The log is from a fresh game profile with no changes made aside from Fabric being the modloader and Wynntils being the only mod.
GUI scale resetting is usually because Minecraft only allows certain scales to be on larger window sizes, so if you're in fullscreen you can set it to 4, but if you restart the game with an initial window size that is much smaller, it will reset the scale to something smaller, I usually experience it resetting to 2.
You can fix that by changing what the initial window size will be.
Also that message about creating a default config is the Wynntils config file, not Minecraft options
GUI scale thing is only when Wynntils is installed tho, it's not a vanilla minecraft thing.
Iirc when I disabled every feature in the book it stopped doing that, but I never found which one does it.
And also to be more specific, Creating default config file with 780 config values.
means that Wynntils has generated a default.json
file, this file is not used by anything but contains all configs set to default value so it can be used as a reference when changing config manually in file.
GUI scale resetting is usually because Minecraft only allows certain scales to be on larger window sizes, so if you're in fullscreen you can set it to 4, but if you restart the game with an initial window size that is much smaller, it will reset the scale to something smaller, I usually experience it resetting to 2.
You can fix that by changing what the initial window size will be.
Also that message about creating a default config is the Wynntils config file, not Minecraft options
I used the GUI scale as a simple thing to tweak since I can clearly see if that is reset or not. This issue occurs when changing any options and will reset all Wynntils keybinds to default. Strangely it does not seem to affect other mod keybinds or vanilla ones if present. Yet the GUI will always reset if Wynntils is installed, this does not occur in vanilla or fabric without extra mods.
I personally never experienced such resets, only GUI scale when launching, altho I noticed a few like literally 3 or 4 reports of having this issue. I kind of ignored it then as I assumed they were using my modpack and there was a rare glitch in one of the included mods that caused that, but perhaps it was Wynntils doing all along.
And also I just remembered my Wynntils keybinds being reset, at that time I assumed some update caused it as I haven't played for some time then but only happened once and was pretty long ago but definitely during 1.20.2.
For reasons I can't really explain, after constantly starting and stopping the game while changing different config options trying to figure out what causes the issue, it's stopped. Everything works fine now, no config resets or GUI scale resetting. I don't know what, if anything, I did to fix it but it works fine now. If it happens again and I can continue to get it to replicate, I will update in a comment. For now though, it seems to have fixed itself.
We had an issue long time ago where all configs were lost if there was a specific kind of error in the config json file, but I thought we rewrote the code to be more robust.
The message:
[Render thread/ERROR]: Illegal option value for translation{key='options.audioDevice', args=[]}
is from vanilla, and can be ignored.
Since the problem is resolved, I'll close this bug.
GUI scale thing is only when Wynntils is installed tho, it's not a vanilla minecraft thing. Iirc when I disabled every feature in the book it stopped doing that, but I never found which one does it.
Ah, my bad I thought it was vanilla.
I have found what causes it though, we reload the options to get our keybinds set using McUtils.options().load();
and since that will reload all of the options including GUI scale it will presumably do a check to see if the value in the file is valid for the current window size, and when it isn't it will be lowered. I presume Minecraft itself will load the options file before the window opens, hence why it doesn't get reset if your window is too small on vanilla
@JamieCallan117 Do you plan to reopen the bug report with your findings, or publish a PR with a fix?
@JamieCallan117 Do you plan to reopen the bug report with your findings, or publish a PR with a fix?
I wouldn't reopen this issue as this was apparently resetting all options, not just GUI scale whereas what I found is only affecting that option. I could look into fixing it but I'm quite busy with screen redesigns at the moment and the issue can easily be avoided by increasing launch window size so it's not a major issue