Add missing player instance check; resolves #754

This commit is contained in:
Daniel Saukel 2020-04-11 02:17:01 +02:00
parent 15a2b86667
commit 39ee708b55

View File

@ -148,6 +148,9 @@ public class PlayerCache extends Registry<Player, GlobalPlayer> {
public Collection<GamePlayer> getAllGamePlayersIf(Predicate<GamePlayer> predicate) {
Collection<GamePlayer> checked = new ArrayList<>();
for (GlobalPlayer element : elements.values()) {
if (!(element instanceof GamePlayer)) {
continue;
}
GamePlayer gamePlayer = (GamePlayer) element;
if (predicate.test(gamePlayer)) {
checked.add(gamePlayer);