Fix rare issue trying to update players before bluemap fully initiallized

This commit is contained in:
Lukas Rieger (Blue) 2022-08-21 00:27:49 +02:00
parent efd365daeb
commit e314d6597e
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2

View File

@ -140,15 +140,15 @@ public void onEnable() {
onlinePlayerList.add(bukkitPlayer);
}
//start updating players
getServer().getScheduler().runTaskTimer(this, this::updateSomePlayers, 1, 1);
//load bluemap
getServer().getScheduler().runTaskAsynchronously(this, () -> {
try {
Logger.global.logInfo("Loading...");
this.pluginInstance.load();
if (pluginInstance.isLoaded()) Logger.global.logInfo("Loaded!");
//start updating players
getServer().getScheduler().runTaskTimer(this, this::updateSomePlayers, 1, 1);
} catch (IOException | RuntimeException e) {
Logger.global.logError("Failed to load!", e);
this.pluginInstance.unload();