Run player login ASync.

This commit is contained in:
Brianna 2020-05-01 04:20:19 -04:00
parent 01cb3fbfe2
commit 6225fec17b
2 changed files with 92 additions and 89 deletions

View File

@ -685,7 +685,8 @@ public class IslandManager {
banManager.createIsland(island.getOwnerUUID()); banManager.createIsland(island.getOwnerUUID());
} }
Bukkit.getServer().getPluginManager().callEvent(new IslandLoadEvent(island.getAPIWrapper())); Bukkit.getScheduler().runTask(skyblock, () ->
Bukkit.getServer().getPluginManager().callEvent(new IslandLoadEvent(island.getAPIWrapper())));
return island; return island;
} }

View File

@ -36,6 +36,7 @@ public class Join implements Listener {
@EventHandler @EventHandler
public void onPlayerJoin(PlayerJoinEvent event) { public void onPlayerJoin(PlayerJoinEvent event) {
Bukkit.getScheduler().runTaskAsynchronously(skyblock, () -> {
Player player = event.getPlayer(); Player player = event.getPlayer();
ScoreboardManager scoreboardManager = skyblock.getScoreboardManager(); ScoreboardManager scoreboardManager = skyblock.getScoreboardManager();
@ -146,5 +147,6 @@ public class Join implements Listener {
// Load Challenge // Load Challenge
SkyBlock.getInstance().getFabledChallenge().getPlayerManager().loadPlayer(player.getUniqueId()); SkyBlock.getInstance().getFabledChallenge().getPlayerManager().loadPlayer(player.getUniqueId());
});
} }
} }