Skip to content

Commit

Permalink
Fixed that end signs didn't work when the player quit the server whil…
Browse files Browse the repository at this point in the history
…e being in a dungeon before; resolves #594
  • Loading branch information
Sataniel98 committed Jun 17, 2019
1 parent 2641fb7 commit 0684e3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/de/erethon/dungeonsxl/player/DGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public PlayerCollection getPlayers() {
*/
public Set<DGlobalPlayer> getDGlobalPlayers() {
Set<DGlobalPlayer> players = new HashSet<>();
for (UUID uuid : this.players.getUniqueIds()) {
for (UUID uuid : this.players) {
players.add(dPlayers.getByUniqueId(uuid));
}
return players;
Expand All @@ -211,7 +211,7 @@ public Set<DGlobalPlayer> getDGlobalPlayers() {
*/
public Set<DGamePlayer> getDGamePlayers() {
Set<DGamePlayer> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -442,6 +441,8 @@ public void onPlayerQuit(PlayerQuitEvent event) {
} else if (dPlayer instanceof DEditPlayer) {
((DEditPlayer) dPlayer).leave();
}

dPlayers.removePlayer(dPlayer);
}

@EventHandler
Expand Down

0 comments on commit 0684e3b

Please sign in to comment.