mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
Implemented entity.getNearbyEntities()
This commit is contained in:
parent
a0b2a26c3a
commit
5247bcba64
@ -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<org.bukkit.entity.Entity> getNearbyEntities(double x, double y, double z){
|
||||
List<Entity> notchEntityList = entity.world.b(entity, entity.boundingBox.b(x,y,z));
|
||||
List<org.bukkit.entity.Entity> bukkitEntityList = new java.util.ArrayList<org.bukkit.entity.Entity>(notchEntityList.size());
|
||||
for (Entity e: notchEntityList){
|
||||
bukkitEntityList.add(e.getBukkitEntity());
|
||||
}
|
||||
return bukkitEntityList;
|
||||
}
|
||||
|
||||
public int getEntityId() {
|
||||
return entity.id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user