Added a configuration option to enable/disable update checking

This commit is contained in:
Shansen 2013-03-01 15:04:24 +01:00
parent 4f54f2f9c5
commit 9ec651ea57
2 changed files with 8 additions and 2 deletions

View File

@ -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) {

View File

@ -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
ConfigVersion: 1.25
CheckForUpdates: true