diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index f3229fb0c..6fc3f9674 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -262,6 +262,8 @@ public class PlayerListener implements Listener { /* GARBAGE COLLECTION */ BleedTimerTask.bleedOut(player); // Bleed it out + UserManager.getPlayer(player).getProfile().save(); + UserManager.remove(player.getName()); } /** diff --git a/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java b/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java index 8b8933cfc..57872b76b 100644 --- a/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileSaveTask.java @@ -1,29 +1,19 @@ package com.gmail.nossr50.runnables.player; -import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.PlayerProfile; -import com.gmail.nossr50.util.player.UserManager; public class PlayerProfileSaveTask extends BukkitRunnable { - private McMMOPlayer mcMMOPlayer; private PlayerProfile playerProfile; public PlayerProfileSaveTask(McMMOPlayer mcMMOPlayer) { - this.mcMMOPlayer = mcMMOPlayer; this.playerProfile = mcMMOPlayer.getProfile(); } @Override public void run() { playerProfile.save(); - - Player player = mcMMOPlayer.getPlayer(); - - if (!player.isOnline()) { - UserManager.remove(player.getName()); - } } }