Fix new GlobalPlayer instances not being wiped on quit

This commit is contained in:
Daniel Saukel 2021-07-08 17:44:40 +02:00
parent f71faf9d7a
commit 048bf3113c
2 changed files with 3 additions and 3 deletions

View File

@ -589,8 +589,8 @@ public class DGroup implements PlayerGroup {
for (UUID playerId : getMembers()) {
GlobalPlayer player = plugin.getPlayerCache().get(playerId);
if (!(player instanceof DGamePlayer)) {
plugin.log("Player isn't a DGamePlayer");
continue;
plugin.log("[ERROR] Player isn't a DGamePlayer, registry: " + plugin.getPlayerCache().getAll());
return;
}
((DGamePlayer) player).startGame();
}

View File

@ -454,7 +454,7 @@ public class DPlayerListener implements Listener {
((InstancePlayer) dPlayer).leave();
}
plugin.getPlayerCache().remove(dPlayer);
plugin.getPlayerCache().remove(plugin.getPlayerCache().get(player));
}
@EventHandler