From 4d31596c7e90b5b95fe85ec8c53acf37bb323e3e Mon Sep 17 00:00:00 2001 From: HexedHero <6012891+HexedHero@users.noreply.github.com> Date: Fri, 2 Oct 2020 20:13:53 +0100 Subject: [PATCH] Double check the player is online closes #171 --- .../java/net/Indyuce/mmoitems/api/player/PlayerData.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/net/Indyuce/mmoitems/api/player/PlayerData.java b/src/main/java/net/Indyuce/mmoitems/api/player/PlayerData.java index 93e77262..742c228a 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/player/PlayerData.java +++ b/src/main/java/net/Indyuce/mmoitems/api/player/PlayerData.java @@ -495,6 +495,13 @@ public class PlayerData { * initialized */ public static void load(Player player) { + + /* + * Double check they are online, for some reason even if this is fired + * from the join event the player can be offline if they left in the same tick or something. + */ + if (!player.isOnline()) + return; MMOPlayerData mmoData = MMOPlayerData.get(player.getUniqueId());