diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 3e1f5acf7a..a9fc75fb44 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1,13 +1,15 @@ package org.bukkit.craftbukkit.entity; import net.minecraft.server.*; -import net.minecraft.server.WorldServer; + import org.bukkit.Location; import org.bukkit.World; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.util.Vector; +import java.util.List; + public abstract class CraftEntity implements org.bukkit.entity.Entity { protected final CraftServer server; protected Entity entity; @@ -127,6 +129,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { teleport(destination); } + public List getNearbyEntities(double x, double y, double z){ + List notchEntityList = entity.world.b(entity, entity.boundingBox.b(x,y,z)); + List bukkitEntityList = new java.util.ArrayList(notchEntityList.size()); + for (Entity e: notchEntityList){ + bukkitEntityList.add(e.getBukkitEntity()); + } + return bukkitEntityList; + } + public int getEntityId() { return entity.id; }