Move update checking to it's own function.

This commit is contained in:
GJ 2013-02-20 11:04:05 -05:00
parent fdeadde7f0
commit 1d87de0a3e

View File

@ -130,15 +130,7 @@ public class mcMMO extends JavaPlugin {
placeStore = ChunkManagerFactory.getChunkManager(); // Get our ChunkletManager placeStore = ChunkManagerFactory.getChunkManager(); // Get our ChunkletManager
try { checkForUpdates();
updateAvailable = Config.getInstance().getUpdateCheckEnabled() && UpdateCheck.updateAvailable();
} catch (Exception e) {
updateAvailable = false;
}
if (updateAvailable) {
getLogger().info(LocaleLoader.getString("UpdateChecker.outdated"));
getLogger().info(LocaleLoader.getString("UpdateChecker.newavailable"));
}
} }
/** /**
@ -152,6 +144,22 @@ public class mcMMO extends JavaPlugin {
modDirectory = mainDirectory + "ModConfigs" + File.separator; modDirectory = mainDirectory + "ModConfigs" + File.separator;
} }
private void checkForUpdates() {
if (Config.getInstance().getUpdateCheckEnabled()) {
try {
updateAvailable = UpdateCheck.updateAvailable();
}
catch (Exception e) {
updateAvailable = false;
}
if (updateAvailable) {
getLogger().info(LocaleLoader.getString("UpdateChecker.outdated"));
getLogger().info(LocaleLoader.getString("UpdateChecker.newavailable"));
}
}
}
/** /**
* Get profile of the player by name. * Get profile of the player by name.
* </br> * </br>