From 701ae54ffccd9864e5ace94cdd1d501457a971a1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 18 Sep 2015 15:15:56 +1000 Subject: [PATCH] SPIGOT-1192: Restore some behaviour to entity.getNearbyEntities --- .../java/org/bukkit/craftbukkit/entity/CraftEntity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index b986a4678d..5693e3a788 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/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() {