Bump config version because we're getting tons of changes
This commit is contained in:
parent
9e4125dd4e
commit
3a6d1366ab
2 changed files with 4 additions and 3 deletions
|
@ -59,7 +59,7 @@ public record TweaksConfig(
|
|||
|
||||
Map<String, Object> knockbackModifiers
|
||||
) {
|
||||
public static final int CONFIG_VERSION = 1;
|
||||
public static final int CONFIG_VERSION = 2;
|
||||
private static TweaksConfig config;
|
||||
|
||||
public static TweaksConfig getConfig() {
|
||||
|
@ -72,10 +72,11 @@ public record TweaksConfig(
|
|||
|
||||
int configVersion = config.getInt("magic number don't modify this", 0);
|
||||
RuntimeException exception = new RuntimeException("Config version is %d, expected %d".formatted(configVersion, CONFIG_VERSION));
|
||||
|
||||
if (configVersion == 0) {
|
||||
throw exception;
|
||||
} else if (configVersion > CONFIG_VERSION) {
|
||||
throw new RuntimeException("Please follow update instructions", exception);
|
||||
throw new RuntimeException("Please follow update instructions https://www.spigotmc.org/resources/tweaks724.121057/updates", exception);
|
||||
} else if (configVersion < CONFIG_VERSION) {
|
||||
throw new RuntimeException("Did you downgrade the plugin? Remove config.yml and let the plugin re-create it", exception);
|
||||
}
|
||||
|
|
|
@ -120,4 +120,4 @@ knockback:
|
|||
# Finally, thank you for downloading Tweaks724, I hope you enjoy!
|
||||
|
||||
# Don't modify unless told to
|
||||
magic number don't modify this: 1
|
||||
magic number don't modify this: 2
|
Loading…
Reference in a new issue