Added update check.

This commit is contained in:
Trent Hensler
2013-03-08 16:03:55 -06:00
parent ae6456b98f
commit 14aae62af8
+3 -10
View File
@@ -31,6 +31,7 @@ public class Main extends JavaPlugin {
loadConfig(); loadConfig();
startMetrics(); startMetrics();
if(getConfig().getBoolean("check-update")) {
Updater u = new Updater(); Updater u = new Updater();
try { try {
if(u.getUpdate()) { if(u.getUpdate()) {
@@ -38,6 +39,8 @@ public class Main extends JavaPlugin {
name = u.getNewVersion(); 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");
}
} }