diff --git a/core/src/main/java/de/erethon/dungeonsxl/player/DGroup.java b/core/src/main/java/de/erethon/dungeonsxl/player/DGroup.java index f06645d7..61b76f0b 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/player/DGroup.java +++ b/core/src/main/java/de/erethon/dungeonsxl/player/DGroup.java @@ -200,7 +200,7 @@ public PlayerCollection getPlayers() { */ public Set getDGlobalPlayers() { Set players = new HashSet<>(); - for (UUID uuid : this.players.getUniqueIds()) { + for (UUID uuid : this.players) { players.add(dPlayers.getByUniqueId(uuid)); } return players; @@ -211,7 +211,7 @@ public Set getDGlobalPlayers() { */ public Set getDGamePlayers() { Set players = new HashSet<>(); - for (UUID uuid : this.players.getUniqueIds()) { + for (UUID uuid : this.players) { DGlobalPlayer dPlayer = dPlayers.getByUniqueId(uuid); if (dPlayer instanceof DGamePlayer) { players.add((DGamePlayer) dPlayer); diff --git a/core/src/main/java/de/erethon/dungeonsxl/player/DPlayerListener.java b/core/src/main/java/de/erethon/dungeonsxl/player/DPlayerListener.java index fe2ca6ae..26196836 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/player/DPlayerListener.java +++ b/core/src/main/java/de/erethon/dungeonsxl/player/DPlayerListener.java @@ -420,7 +420,6 @@ public void onPlayerQuit(PlayerQuitEvent event) { Game game = Game.getByWorld(player.getWorld()); if (!(dPlayer instanceof DInstancePlayer)) { - dPlayers.removePlayer(dPlayer); if (dGroup != null) { dGroup.removePlayer(player); } @@ -442,6 +441,8 @@ public void onPlayerQuit(PlayerQuitEvent event) { } else if (dPlayer instanceof DEditPlayer) { ((DEditPlayer) dPlayer).leave(); } + + dPlayers.removePlayer(dPlayer); } @EventHandler