Fixed yet another another ANOTHER Player must be online error

This commit is contained in:
ASangarin 2020-12-21 20:15:00 +01:00
parent 0396eaaef8
commit 59dd7ba4e1

View File

@ -47,8 +47,12 @@ public abstract class PlayerDataManager {
*/ */
Bukkit.getScheduler().runTaskAsynchronously(MMOCore.plugin, () -> { Bukkit.getScheduler().runTaskAsynchronously(MMOCore.plugin, () -> {
PlayerData loaded = PlayerData.get(uuid); PlayerData loaded = PlayerData.get(uuid);
if(!loaded.isOnline()) return;
loadData(loaded); 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(); loaded.getStats().updateStats();
}); });
} }