Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config gets overwritten #69

Closed
jaceee opened this issue Aug 18, 2024 · 9 comments
Closed

config gets overwritten #69

jaceee opened this issue Aug 18, 2024 · 9 comments
Labels
1.21-0.4.0 Will be added in the 1.21-0.4.0 release enhancement New feature or request question Further information is requested

Comments

@jaceee
Copy link

jaceee commented Aug 18, 2024

Every time I restart my fabric server the default config replaces my config

@tpwalke2
Copy link
Owner

Which version of Minecraft are you using?

Would you be able to attach your config file and a log file that shows the server startup?

@elboletaire
Copy link

Every time I restart my fabric server the default config replaces my config

Uh, yeah, I also noticed that. You have to stop the server, then do changes, then boot it up again. When shutting the server down the mod always rewrites the file.

@tpwalke2
Copy link
Owner

@jaceee, can you confirm that you are encountering similar behavior as @elboletaire where you edit the config while the server is running but then shutting down the server overwrites the changes?

@elboletaire
Copy link

elboletaire commented Aug 25, 2024

@jaceee, can you confirm that you are encountering similar behavior as @elboletaire where you edit the config while the server is running but then shutting down the server overwrites the changes?

I think it's expected, considering the config is being overwritten on shutdown: https://github.com/tpwalke2/BlueMapSignMarkers/blob/main/src/main/java/com/tpwalke2/bluemapsignmarkers/BlueMapSignMarkersMod.java#L34

The actual problem is not the settings being overwritten in that point, but the fact that they get overwritten with the data on memory, rather than trying to read the file first to see if there are any changes, so that makes the file always look as the server was first boot up.

If the mod had some way to reload its config on game, I'd do that just before shutting it down. If there's some way to add this as a callback/event of bluemap's reload function, it would be a good idea to link this reload logic to the bluemap one too (just to avoid having to create commands for this mod).

edit: or maybe just stop saving on shutdown? 🤔

@tpwalke2
Copy link
Owner

Yeah, I think not saving on shutdown would be the simplest approach.

@tpwalke2 tpwalke2 added question Further information is requested enhancement New feature or request 1.21-0.4.0 Will be added in the 1.21-0.4.0 release labels Aug 25, 2024
tpwalke2 added a commit that referenced this issue Aug 25, 2024
#69 Only save config during load, not shutdown
@tpwalke2
Copy link
Owner

@jaceee, @elboletaire, I have merged the PR (#75) for this update to main. The mod will only save the config during the load if a config file is not present (new installations) or if there is an upgrade migration from a previous config version.

There are a few other items I am targeting for the same version (1.21-0.4.0), however. You can track the progress of those issues here: https://github.com/tpwalke2/BlueMapSignMarkers/issues?q=is%3Aissue+is%3Aopen+label%3A1.21-0.4.0

@tpwalke2
Copy link
Owner

tpwalke2 commented Sep 4, 2024

@jaceee, @elboletaire, I have published a release to modrinth that contains this update: https://modrinth.com/mod/bluemap-sign-markers/version/1.21-0.4.0.30

@elboletaire
Copy link

elboletaire commented Sep 4, 2024

@jaceee, @elboletaire, I have published a release to modrinth that contains this update: modrinth.com/mod/bluemap-sign-markers/version/1.21-0.4.0.30

Will try it as soon as I get out of office!

edit: ok, I forgot yesterday... will try today 😅

@elboletaire
Copy link

@jaceee, @elboletaire, I have published a release to modrinth that contains this update: modrinth.com/mod/bluemap-sign-markers/version/1.21-0.4.0.30

Sadly, I can't try yet, since my server is stuck on version 1.20.6 due to mods that still haven’t received updates 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21-0.4.0 Will be added in the 1.21-0.4.0 release enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants