Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
Implemented entity.getNearbyEntities()
Dieser Commit ist enthalten in:
Ursprung
a0b2a26c3a
Commit
5247bcba64
@ -1,13 +1,15 @@
|
|||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
import net.minecraft.server.*;
|
import net.minecraft.server.*;
|
||||||
import net.minecraft.server.WorldServer;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.craftbukkit.CraftWorld;
|
import org.bukkit.craftbukkit.CraftWorld;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
protected final CraftServer server;
|
protected final CraftServer server;
|
||||||
protected Entity entity;
|
protected Entity entity;
|
||||||
@ -127,6 +129,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|||||||
teleport(destination);
|
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() {
|
public int getEntityId() {
|
||||||
return entity.id;
|
return entity.id;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren