NiklasEi / gamebox

Minecraft plugin with a vast selection of inventory games
http://gamebox.nikl.me
GNU General Public License v3.0
16 stars 13 forks source link

Notify abount missing config options #69

Open RoboMWM opened 5 years ago

RoboMWM commented 5 years ago

When checking to see if there was an option to preserve armor while in a game, I found that my config was outdated despite being on gamebox 2.2.4. It seems you don't update the config; I assume it only copies over from jar on first install. Would you mind programmatically adding missing entries, or at least notifying if some entries are missing?

NiklasEi commented 5 years ago

I don't want to add them because saving the config would remove all comments. Logging missing entries might be a solution, but could get anoying rather fast since there can be several new entries in an update.

RoboMWM commented 5 years ago

I believe mcmmo does something where they update the config and preserve comments - but I'm not sure, maybe I'm not recalling. But yea, the bukkit YAML will delete comments. Another way which might not be as neat is to put all of the comments and examples in the header like SimpleBackup does. NCP does the "notify" in console (and in-game too), but it also writes to the config if entries are missing and doesn't have comments.

I'd opt for a config option for printing/updating the config (also present in mcmmo and essentials IIRC), but if you really don't want to "be annoying" you could save the last time you printed out missing config options and not start up if the missing nodes printed last time haven't changed.

NiklasEi commented 5 years ago

[...] but if you really don't want to "be annoying" you could save the last time you printed out missing config options and not start up if the missing nodes printed last time haven't changed.

I think that would be even more annoying. In most cases almost all users will keep the default settings. Meaning it's no use for them to actually add the options to the file.

What do you think about a "diff file" and a short notice on startup about it. This file would contain all missing nodes with default settings. To get rid of the notice one could simply copy paste the diff file content to the config. This would keep the logging short (only point to diff file, no node listing) and make it easier to get rid of the message. Oc there also can be an option to turn that behaviour off.

RoboMWM commented 5 years ago

I meant not start up as in not print the missing nodes again. Sorry for the confusion.