Better Statistics Screen

Better Statistics Screen

21M Downloads

[v3.8+fabric-1.20.X] Perm Disable configes

AlvinKitchens opened this issue ยท 3 comments

commented

What is this suggestion for?

Mod Itself

Suggestion

I would like to have it were when i disable a option that it doesnt re-enable itself after i relaunch minecraft cause this is what keeps happening with enable stats announcement system and its very annoying.

Code of Conduct

  • I agree that I will be available later for any follow-up questions to help with implementing the suggested thing.
commented

I wasnt sure if it was a bug at the time i thought it was a intended thing which is kinda stupid of me lol

commented

Hello.
Thank you for submitting the issue. This appears to be more of a bug, rather than a suggestion, as the config is supposed to be preserved on each relaunch.

Just in case I missed something or in case there was an oversight in my code, I will try testing this on my end. If I understood correctly, your config resets to default or something whenever you relaunch the game. In the meantime, I'd like to suggest a few checks you could make:

  • When editing configs in-game, make sure you press the "Done" button, as pressing ESC and "Cancel" cancels all changes
  • Ensure the mod has access to the /config/betterstats.json file on your operating system. Altho I programmed it so the mod crashes when it fails to load the config, there might be a chance that's still something to look for.
  • Are you relaunching a new instance of Minecraft, or the same one? (Edit: By this I meant, when dealing with 3rd party launchers, you can create multiple "profiles"/"instances" of the game)
  • And last thing I can think of, list the mods you have installed, perhaps there's a conflict messing with this mod

Now I'll go check it out myself to see if there was an oversight I made.

commented

After some more testing, it appears the "Done" button for some reason is not actually saving the config to the hard drive, which is obviously not intended. I will work on resolving this issue. In the meantime, you can open the /config/betterstats.json file, and disable the SAS manually.

ETA:
It appears the mistake I made is "not deleting any existing files before overriding" when saving config changes, as when overriding files, for some reason the system wants you to delete the previous one:

Caused by: java.nio.file.FileAlreadyExistsException: C:\Users\User\Desktop\Workspace\GitHub\mc-better-stats\betterstats-3-fabric-1.20.1\run\config\betterstats.json
	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:87)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236)
	at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484)
	at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
	at java.base/java.nio.file.Files.write(Files.java:3512)
	at java.base/java.nio.file.Files.writeString(Files.java:3734)
	at java.base/java.nio.file.Files.writeString(Files.java:3674)
	at io.github.thecsdev.tcdcommons.api.config.AutoConfig.saveToFile(AutoConfig.java:188)
	... 30 more

And given I have also coded the "Done" button to suppress any errors that come out, that went unnoticed for too long. Thank you so much for noticing and reporting it!