Start update checking immediately:
Initializing the Updater class from the main thread allows the Updater thread to begin its query before the first server tick, which is when the scheduled task will begin. Gotta get that update!
This commit is contained in:
@@ -136,10 +136,10 @@ public class PlayerVaults extends JavaPlugin {
|
|||||||
final PlayerVaults plugin = this;
|
final PlayerVaults plugin = this;
|
||||||
final File file = this.getFile();
|
final File file = this.getFile();
|
||||||
final Updater.UpdateType updateType = getConfig().getBoolean("download-update", true) ? Updater.UpdateType.DEFAULT : Updater.UpdateType.NO_DOWNLOAD;
|
final Updater.UpdateType updateType = getConfig().getBoolean("download-update", true) ? Updater.UpdateType.DEFAULT : Updater.UpdateType.NO_DOWNLOAD;
|
||||||
|
final Updater updater = new Updater(plugin, 50123, file, updateType, false);
|
||||||
getServer().getScheduler().runTaskAsynchronously(this, new Runnable() {
|
getServer().getScheduler().runTaskAsynchronously(this, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Updater updater = new Updater(plugin, 50123, file, updateType, false);
|
|
||||||
update = updater.getResult() == Updater.UpdateResult.UPDATE_AVAILABLE;
|
update = updater.getResult() == Updater.UpdateResult.UPDATE_AVAILABLE;
|
||||||
name = updater.getLatestName();
|
name = updater.getLatestName();
|
||||||
if (updater.getResult() == Updater.UpdateResult.SUCCESS) {
|
if (updater.getResult() == Updater.UpdateResult.SUCCESS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user