mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Add missing player instance check; resolves #754
This commit is contained in:
parent
15a2b86667
commit
39ee708b55
@ -148,6 +148,9 @@ public class PlayerCache extends Registry<Player, GlobalPlayer> {
|
|||||||
public Collection<GamePlayer> getAllGamePlayersIf(Predicate<GamePlayer> predicate) {
|
public Collection<GamePlayer> getAllGamePlayersIf(Predicate<GamePlayer> predicate) {
|
||||||
Collection<GamePlayer> checked = new ArrayList<>();
|
Collection<GamePlayer> checked = new ArrayList<>();
|
||||||
for (GlobalPlayer element : elements.values()) {
|
for (GlobalPlayer element : elements.values()) {
|
||||||
|
if (!(element instanceof GamePlayer)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
GamePlayer gamePlayer = (GamePlayer) element;
|
GamePlayer gamePlayer = (GamePlayer) element;
|
||||||
if (predicate.test(gamePlayer)) {
|
if (predicate.test(gamePlayer)) {
|
||||||
checked.add(gamePlayer);
|
checked.add(gamePlayer);
|
||||||
|
Loading…
Reference in New Issue
Block a user