mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Implement World.getEntity(UUID) API
This commit is contained in:
parent
b7f23ee86d
commit
7749dcdd84
1 changed files with 9 additions and 0 deletions
|
@ -1130,6 +1130,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|||
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
|
||||
public void save() {
|
||||
org.spigotmc.AsyncCatcher.catchOp("world save"); // Spigot
|
||||
|
|
Loading…
Reference in a new issue