From 9ec651ea57c9bb3017623b92ec02819d6fa222c3 Mon Sep 17 00:00:00 2001 From: Shansen Date: Fri, 1 Mar 2013 15:04:24 +0100 Subject: [PATCH] Added a configuration option to enable/disable update checking --- src/main/java/me/shansen/EggCatcher/EggCatcher.java | 7 ++++++- src/main/resources/config.yml | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/shansen/EggCatcher/EggCatcher.java b/src/main/java/me/shansen/EggCatcher/EggCatcher.java index a98c6e9..7976325 100644 --- a/src/main/java/me/shansen/EggCatcher/EggCatcher.java +++ b/src/main/java/me/shansen/EggCatcher/EggCatcher.java @@ -45,8 +45,12 @@ public class EggCatcher extends JavaPlugin { } public void onEnable() { - this.CheckUpdate(); this.CheckConfigurationFile(); + + if (this.getConfig().getBoolean("CheckForUpdates")) { + this.CheckUpdate(); + } + PluginManager pm = this.getServer().getPluginManager(); final EggCatcherPlayerListener playerListener = new EggCatcherPlayerListener(); @@ -122,6 +126,7 @@ public class EggCatcher extends JavaPlugin { this.getConfig().set("HealthPercentage.Bat", 100.0); this.getConfig().set("Messages.HealthPercentageFail", "The mob has more than %s percent health left and " + "cannot be caught!"); + this.getConfig().set("CheckForUpdates", true); this.getConfig().set("ConfigVersion", 1.25); this.saveConfig(); } else if (configVersion == 1.21) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 7297f88..b3dce5c 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -120,4 +120,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: 1.25 \ No newline at end of file +ConfigVersion: 1.25 +CheckForUpdates: true \ No newline at end of file