From 3b613360d47a48656c3289dfc6cf4af85ceb0419 Mon Sep 17 00:00:00 2001 From: shansen Date: Fri, 30 Jan 2015 18:03:50 +0100 Subject: [PATCH] Updated configuration file updater --- .../me/shansen/EggCatcher/EggCatcher.java | 20 ++++++++++++++++++- src/main/resources/config.yml | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/shansen/EggCatcher/EggCatcher.java b/src/main/java/me/shansen/EggCatcher/EggCatcher.java index ce584bc..dbdfe1e 100644 --- a/src/main/java/me/shansen/EggCatcher/EggCatcher.java +++ b/src/main/java/me/shansen/EggCatcher/EggCatcher.java @@ -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(); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 201fe21..0c7b8c7 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -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 \ No newline at end of file