plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
@Override
public void run() {
// Check for updates
if (OpenInv.GetCheckForUpdates()) {
UpdateResult result = updater.update();
if (result != UpdateResult.NO_UPDATE) {
if (result == UpdateResult.SUCCESS) {
OpenInv.log("Update found! Downloaded new version.");
OpenInv.log("This behaviour can be disabled in the config.yml");
}
else {
OpenInv.log("Update failed, reason: " + result.toString());
}
}
}
}
}, 0, 20 * 60 * 1000); // Update every once a while