From c94860913e85fd594db9c645a9b804a324191bde Mon Sep 17 00:00:00 2001 From: Fabrizio La Rosa Date: Tue, 4 Aug 2020 00:24:24 +0200 Subject: [PATCH] Fix npe on join --- src/main/java/com/songoda/skyblock/listeners/Join.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/songoda/skyblock/listeners/Join.java b/src/main/java/com/songoda/skyblock/listeners/Join.java index daad4929..e9d73d19 100644 --- a/src/main/java/com/songoda/skyblock/listeners/Join.java +++ b/src/main/java/com/songoda/skyblock/listeners/Join.java @@ -114,9 +114,12 @@ public class Join implements Listener { // Load Challenge SkyBlock.getInstance().getFabledChallenge().getPlayerManager().loadPlayer(player.getUniqueId()); + + Bukkit.getScheduler().runTask(plugin, () -> { + if (scoreboardManager != null && playerDataManager.getPlayerData(player).isScoreboard()) { + scoreboardManager.updatePlayerScoreboardType(player); + } + }); }); - if (scoreboardManager != null && playerDataManager.getPlayerData(player).isScoreboard()) { - scoreboardManager.updatePlayerScoreboardType(player); - } } }