Implement World.getEntity(UUID) API

This commit is contained in:
Brokkonaut 2018-07-03 16:08:14 +02:00
parent b7f23ee86d
commit 7749dcdd84

View file

@ -1130,6 +1130,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return list; return list;
} }
// Paper start - getEntity by UUID API
@Override
public Entity getEntity(UUID uuid) {
Preconditions.checkArgument(uuid != null, "UUID cannot be null");
net.minecraft.world.entity.Entity entity = world.getEntity(uuid);
return entity == null ? null : entity.getBukkitEntity();
}
// Paper end
@Override @Override
public void save() { public void save() {
org.spigotmc.AsyncCatcher.catchOp("world save"); // Spigot org.spigotmc.AsyncCatcher.catchOp("world save"); // Spigot