Added update check.
This commit is contained in:
@@ -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");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user