From 59dd7ba4e1af6b643962ac36bbf9212cfeb81822 Mon Sep 17 00:00:00 2001 From: ASangarin Date: Mon, 21 Dec 2020 20:15:00 +0100 Subject: [PATCH] Fixed yet another another ANOTHER Player must be online error --- .../net/Indyuce/mmocore/manager/data/PlayerDataManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/Indyuce/mmocore/manager/data/PlayerDataManager.java b/src/main/java/net/Indyuce/mmocore/manager/data/PlayerDataManager.java index 6a638b9f..e653e3e1 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/data/PlayerDataManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/data/PlayerDataManager.java @@ -47,8 +47,12 @@ public abstract class PlayerDataManager { */ Bukkit.getScheduler().runTaskAsynchronously(MMOCore.plugin, () -> { PlayerData loaded = PlayerData.get(uuid); + if(!loaded.isOnline()) return; loadData(loaded); - Bukkit.getScheduler().runTask(MMOCore.plugin, () -> Bukkit.getPluginManager().callEvent(new PlayerDataLoadEvent(loaded))); + Bukkit.getScheduler().runTask(MMOCore.plugin, () -> { + if(loaded.isOnline()) + Bukkit.getPluginManager().callEvent(new PlayerDataLoadEvent(loaded)); + }); loaded.getStats().updateStats(); }); }