Added update check.

This commit is contained in:
Trent Hensler
2013-03-08 16:03:55 -06:00
parent ae6456b98f
commit 14aae62af8
+10 -17
View File
@@ -31,13 +31,16 @@ public class Main extends JavaPlugin {
loadConfig(); loadConfig();
startMetrics(); startMetrics();
Updater u = new Updater(); if(getConfig().getBoolean("check-update")) {
try { Updater u = new Updater();
if(u.getUpdate()) { try {
update = true; if(u.getUpdate()) {
name = u.getNewVersion(); update = true;
} name = u.getNewVersion();
} catch (Exception e) {} }
} catch (Exception e) {}
}
commands = new Commands(); commands = new Commands();
getCommand("pv").setExecutor(commands); getCommand("pv").setExecutor(commands);
getCommand("pvdel").setExecutor(commands); getCommand("pvdel").setExecutor(commands);
@@ -83,14 +86,4 @@ public class Main extends JavaPlugin {
Lang.setFile(conf); Lang.setFile(conf);
return conf; return conf;
} }
/**
* Methods to get values from the config.
* public so any class / plugin can get them.
*/
public boolean updateCheck() {
return getConfig().getBoolean("check-update");
}
} }