From 0684e3b34ae36da3f528566dcc4b79fde720d747 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Tue, 18 Jun 2019 00:16:13 +0200 Subject: [PATCH] Fixed that end signs didn't work when the player quit the server while being in a dungeon before; resolves #594 --- core/src/main/java/de/erethon/dungeonsxl/player/DGroup.java | 4 ++-- .../java/de/erethon/dungeonsxl/player/DPlayerListener.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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 class DGroup { */ 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 class DGroup { */ 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 class DPlayerListener implements Listener { Game game = Game.getByWorld(player.getWorld()); if (!(dPlayer instanceof DInstancePlayer)) { - dPlayers.removePlayer(dPlayer); if (dGroup != null) { dGroup.removePlayer(player); } @@ -442,6 +441,8 @@ public class DPlayerListener implements Listener { } else if (dPlayer instanceof DEditPlayer) { ((DEditPlayer) dPlayer).leave(); } + + dPlayers.removePlayer(dPlayer); } @EventHandler