Overwrite configuration files older than 3.0
This commit is contained in:
parent
f28dad66f4
commit
7da6b04898
|
@ -64,37 +64,7 @@ public class EggCatcher extends JavaPlugin {
|
|||
|
||||
public void CheckConfigurationFile() {
|
||||
double configVersion = this.getConfig().getDouble("ConfigVersion", 0.0);
|
||||
if (configVersion == 2.6) {
|
||||
this.saveConfig();
|
||||
} else if (configVersion == 2.5) {
|
||||
this.getConfig().set("CatchChance.PolarBear", 100.0);
|
||||
this.getConfig().set("VaultCost.PolarBear", 0);
|
||||
this.getConfig().set("ItemCost.Amount.PolarBear", 0);
|
||||
this.getConfig().set("HealthPercentage.PolarBear", 100.0);
|
||||
this.getConfig().set("ConfigVersion", 2.6);
|
||||
this.saveConfig();
|
||||
} else if (configVersion == 2.2) {
|
||||
this.getConfig().set("DeleteVillagerInventoryOnCatch", false);
|
||||
|
||||
this.getConfig().set("ConfigVersion", 2.5);
|
||||
this.saveConfig();
|
||||
} else if (configVersion == 2.0) {
|
||||
this.getConfig().set("CatchChance.Endermite", 100.0);
|
||||
this.getConfig().set("VaultCost.Endermite", 0);
|
||||
this.getConfig().set("ItemCost.Amount.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.Amount.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.Amount.Rabbit", 0);
|
||||
this.getConfig().set("HealthPercentage.Rabbit", 100.0);
|
||||
|
||||
this.getConfig().set("ConfigVersion", 2.2);
|
||||
if (configVersion == 3.0) {
|
||||
this.saveConfig();
|
||||
} else {
|
||||
this.saveResource("config.yml", true);
|
||||
|
|
Loading…
Reference in New Issue