Tameable#getOwnerUniqueId API

This is faster if all you need is the UUID, as .getOwner() will cause
an OfflinePlayer to be loaded from disk.
This commit is contained in:
Aikar 2018-02-24 01:14:55 -05:00
parent 794fc9799b
commit 4b38f09815
2 changed files with 8 additions and 0 deletions

View File

@ -88,6 +88,10 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
} }
} }
@Override
public UUID getOwnerUniqueId() {
return getOwnerUUID();
}
public UUID getOwnerUUID() { public UUID getOwnerUUID() {
return this.getHandle().getOwnerUUID(); return this.getHandle().getOwnerUUID();
} }

View File

@ -17,6 +17,10 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat
return (TamableAnimal) super.getHandle(); return (TamableAnimal) super.getHandle();
} }
@Override
public UUID getOwnerUniqueId() {
return getOwnerUUID();
}
public UUID getOwnerUUID() { public UUID getOwnerUUID() {
try { try {
return this.getHandle().getOwnerUUID(); return this.getHandle().getOwnerUUID();