Implemented entity.getNearbyEntities()
Dieser Commit ist enthalten in:
Ursprung
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;
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren