Added version to config file for the future

This commit is contained in:
coolGi2007
2022-02-11 16:07:10 +10:30
parent c59d7a7d27
commit f05e878600
2 changed files with 25 additions and 1 deletions
@@ -339,6 +339,18 @@ public abstract class ConfigGui
loadFileWithErrorCheck(config);
// Just put this here for the future
config.setComment("_Version", " DONT TOUCH THIS, IF YOU DO THEN CONFIG FILE WOULD BREAK");
if (config.contains("_Version")) {
if (config.get("_Version") != ModInfo.VERSION) {
LOGGER.error("THERE IS A PROBLEM WITH THE CONFIG FILE");
LOGGER.error("You have downgraded your mod, this could cause problems with your config");
}
}
config.set("_Versions", ModInfo.VERSION);
for (EntryInfo info : entries) {
if (info.field.isAnnotationPresent(ConfigAnnotations.Entry.class)) {
editSingleOption.saveOption(info, config);
@@ -369,6 +381,18 @@ public abstract class ConfigGui
loadFileWithErrorCheck(config);
// Just put this here for the future
config.setComment("_Version", " DONT TOUCH THIS, IF YOU DO THEN CONFIG FILE WOULD BREAK");
if (config.contains("_Version")) {
if (config.get("_Version") != ModInfo.VERSION) {
LOGGER.error("THERE IS A PROBLEM WITH THE CONFIG FILE");
LOGGER.error("You have downgraded your mod, this could cause problems with your config");
}
}
config.set("_Versions", ModInfo.VERSION);
// Puts everything into its variable
for (EntryInfo info : entries) {
if (info.field.isAnnotationPresent(ConfigAnnotations.Entry.class)) {
+1 -1
Submodule core updated: f7da53622c...5d72d321db