Updated configuration file updater

This commit is contained in:
shansen 2015-01-30 18:03:50 +01:00
parent dbf74377d5
commit 3b613360d4
2 changed files with 20 additions and 2 deletions

View File

@ -72,7 +72,25 @@ public class EggCatcher extends JavaPlugin {
public void CheckConfigurationFile() {
double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0);
if (configVersion != 2.00) {
if (configVersion == 2.0) {
this.getConfig().set("CatchChance.Endermite", 100.0);
this.getConfig().set("VaultCost.Endermite", 0);
this.getConfig().set("ItemCost.Endermite", 0);
this.getConfig().set("HealthPercentage.Endermite", 100.0);
this.getConfig().set("CatchChance.Guardian", 100.0);
this.getConfig().set("VaultCost.Guardian", 0);
this.getConfig().set("ItemCost.Guardian", 0);
this.getConfig().set("HealthPercentage.Guardian", 100.0);
this.getConfig().set("CatchChance.Rabbit", 100.0);
this.getConfig().set("VaultCost.Rabbit", 0);
this.getConfig().set("ItemCost.Rabbit", 0);
this.getConfig().set("HealthPercentage.Rabbit", 100.0);
this.getConfig().set("ConfigVersion", 2.2);
this.saveConfig();
} else {
this.saveResource("config.yml", true);
this.reloadConfig();
}

View File

@ -137,5 +137,5 @@ Messages:
CatchChanceFail: "You failed to catch this mob!"
CatchChanceSuccess: ""
HealthPercentageFail: "The mob has more than %s percent health left and cannot be caught!"
ConfigVersion: 2.00
ConfigVersion: 2.2
CheckForUpdates: true