From 08a3d51d7c0d85a376eba5647ea76a873b9430c2 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 18 Sep 2015 15:15:56 +1000 Subject: [PATCH] SPIGOT-1192: Restore some behaviour to entity.getNearbyEntities By: md_5 --- .../java/org/bukkit/craftbukkit/entity/CraftEntity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index b986a4678d..5693e3a788 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -249,7 +249,13 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } public List getNearbyEntities(double x, double y, double z) { - return new ArrayList(getHandle().getWorld().getWorld().getNearbyEntities(getLocation(), x, y, z)); + List notchEntityList = entity.world.a(entity, entity.getBoundingBox().grow(x, y, z), null); + List bukkitEntityList = new java.util.ArrayList(notchEntityList.size()); + + for (Entity e : notchEntityList) { + bukkitEntityList.add(e.getBukkitEntity()); + } + return bukkitEntityList; } public int getEntityId() {