Require not null bosses.

This commit is contained in:
Brianna 2020-02-01 07:14:18 -05:00
parent 010ac0ad15
commit 63a88682ce
1 changed files with 1 additions and 0 deletions

View File

@ -105,6 +105,7 @@ public class ActiveBossHolder implements IActiveHolder {
// grab list of all valid entities by UUID that can be removed
Map<Integer, Entity> toRemove = this.livingEntityMap.entrySet().stream()
.filter(Objects::nonNull) // This may fix ticket #4522
.collect(Collectors.toMap(Map.Entry::getKey, e -> ServerUtils.get().getEntity(e.getValue())))
.entrySet().stream()
.filter(e -> e.getValue() != null && e.getValue().getWorld().isChunkLoaded(