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); onlinePlayerList.add(bukkitPlayer);
} }
//start updating players
getServer().getScheduler().runTaskTimer(this, this::updateSomePlayers, 1, 1);
//load bluemap //load bluemap
getServer().getScheduler().runTaskAsynchronously(this, () -> { getServer().getScheduler().runTaskAsynchronously(this, () -> {
try { try {
Logger.global.logInfo("Loading..."); Logger.global.logInfo("Loading...");
this.pluginInstance.load(); this.pluginInstance.load();
if (pluginInstance.isLoaded()) Logger.global.logInfo("Loaded!"); if (pluginInstance.isLoaded()) Logger.global.logInfo("Loaded!");
//start updating players
getServer().getScheduler().runTaskTimer(this, this::updateSomePlayers, 1, 1);
} catch (IOException | RuntimeException e) { } catch (IOException | RuntimeException e) {
Logger.global.logError("Failed to load!", e); Logger.global.logError("Failed to load!", e);
this.pluginInstance.unload(); this.pluginInstance.unload();