Add configuration updater

This commit is contained in:
shansen 2017-06-09 01:19:26 +02:00
parent b915530a30
commit e313a1c41c
1 changed files with 10 additions and 1 deletions

View File

@ -57,7 +57,16 @@ public class EggCatcher extends JavaPlugin {
public void CheckConfigurationFile() {
double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0);
if (configVersion == 3.0) {
if (configVersion == 3.1) {
this.saveConfig();
}
else if (configVersion == 3.0) {
this.getConfig().set("CatchChance.Parrot", 100.0);
this.getConfig().set("VaultCost.Parrot", 0.0);
this.getConfig().set("ItemCost.Amount.Parrot", 0.0);
this.getConfig().set("HealthPercentage.Parrot", 100.0);
this.getConfig().set("ConfigVersion", 3.1);
this.saveConfig();
} else {
this.saveResource("config.yml", true);