Added update check.
This commit is contained in:
@@ -31,6 +31,7 @@ public class Main extends JavaPlugin {
|
||||
loadConfig();
|
||||
startMetrics();
|
||||
|
||||
if(getConfig().getBoolean("check-update")) {
|
||||
Updater u = new Updater();
|
||||
try {
|
||||
if(u.getUpdate()) {
|
||||
@@ -38,6 +39,8 @@ public class Main extends JavaPlugin {
|
||||
name = u.getNewVersion();
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
|
||||
commands = new Commands();
|
||||
getCommand("pv").setExecutor(commands);
|
||||
getCommand("pvdel").setExecutor(commands);
|
||||
@@ -83,14 +86,4 @@ public class Main extends JavaPlugin {
|
||||
Lang.setFile(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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user