From 0f09d1e47062dbe09205765eeacc9908cdf19571 Mon Sep 17 00:00:00 2001 From: ASangarin Date: Sat, 1 Aug 2020 21:50:25 +0200 Subject: [PATCH] Fixed a few PlayerData errors --- .../java/net/Indyuce/mmocore/api/player/CombatRunnable.java | 1 + .../mmocore/manager/data/yaml/YAMLPlayerDataManager.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/Indyuce/mmocore/api/player/CombatRunnable.java b/src/main/java/net/Indyuce/mmocore/api/player/CombatRunnable.java index 572a6617..bc114c29 100644 --- a/src/main/java/net/Indyuce/mmocore/api/player/CombatRunnable.java +++ b/src/main/java/net/Indyuce/mmocore/api/player/CombatRunnable.java @@ -25,6 +25,7 @@ public class CombatRunnable extends BukkitRunnable { @Override public void run() { + if(!player.isOnline()) { close(); return; } if (lastHit + MMOCore.plugin.configManager.combatLogTimer < System.currentTimeMillis()) { Bukkit.getPluginManager().callEvent(new PlayerCombatEvent(player, false)); MMOCore.plugin.configManager.getSimpleMessage("leave-combat").send(player.getPlayer()); diff --git a/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java b/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java index 67f9f0e8..e99b4070 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java @@ -72,7 +72,7 @@ public class YAMLPlayerDataManager extends PlayerDataManager { @Override public void saveData(PlayerData data) { - ConfigFile file = new ConfigFile(data.getPlayer()); + ConfigFile file = new ConfigFile(data.getUniqueId()); FileConfiguration config = file.getConfig(); config.set("class-points", data.getClassPoints());