Fix NPE with Entity.getNearbyEntities

This commit is contained in:
md_5 2021-06-11 18:48:59 +10:00
parent d747f8ed15
commit a3df386f7c
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.entity;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicates;
import com.google.common.collect.Lists;
import java.util.List;
import java.util.Set;
@ -526,7 +527,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@Override
public List<org.bukkit.entity.Entity> getNearbyEntities(double x, double y, double z) {
List<Entity> notchEntityList = entity.level.getEntities(entity, entity.getBoundingBox().grow(x, y, z), null);
List<Entity> notchEntityList = entity.level.getEntities(entity, entity.getBoundingBox().grow(x, y, z), Predicates.alwaysTrue());
List<org.bukkit.entity.Entity> bukkitEntityList = new java.util.ArrayList<org.bukkit.entity.Entity>(notchEntityList.size());
for (Entity e : notchEntityList) {