Do a lot of work on the updater, make it compatible with dev builds

This commit is contained in:
gomeow
2013-06-08 16:09:07 -04:00
parent 62f4646a1b
commit e4def202f5
2 changed files with 46 additions and 62 deletions
@@ -101,16 +101,19 @@ public class PlayerVaults extends JavaPlugin {
new BukkitRunnable() {
public void run() {
Updater u = new Updater();
if (getConfig().getBoolean("check-update")) {
try {
if (u.getUpdate(getDescription().getVersion())) {
UPDATE = true;
if (getConfig().getBoolean("check-update")) {
try {
Updater u = new Updater(getDescription().getVersion());
if (UPDATE = u.getUpdate()) {
LINK = u.getLink();
NEWVERSION = u.getNewVersion();
}
} catch(Exception e) {
getLogger().log(Level.WARNING, "Failed to check for updates.");
getLogger().log(Level.WARNING, "Report this stack trace to gomeow.");
e.printStackTrace();
}
} catch(IOException e) {
log.log(Level.WARNING, "PlayerVaults: Failed to check for updates.");
log.log(Level.WARNING, "PlayerVaults: Report this stack trace to drtshock and gomeow.");
e.printStackTrace();
}
}
}