From 4b38f0981583eadac3f28f9349d18ebe61cabdf6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 24 Feb 2018 01:14:55 -0500 Subject: [PATCH] Tameable#getOwnerUniqueId API This is faster if all you need is the UUID, as .getOwner() will cause an OfflinePlayer to be loaded from disk. --- .../org/bukkit/craftbukkit/entity/CraftAbstractHorse.java | 4 ++++ .../org/bukkit/craftbukkit/entity/CraftTameableAnimal.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java index 5192fa2aeb..3952e52b94 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java @@ -88,6 +88,10 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac } } + @Override + public UUID getOwnerUniqueId() { + return getOwnerUUID(); + } public UUID getOwnerUUID() { return this.getHandle().getOwnerUUID(); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java index 3d19a077db..cedb8e67e2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java @@ -17,6 +17,10 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat return (TamableAnimal) super.getHandle(); } + @Override + public UUID getOwnerUniqueId() { + return getOwnerUUID(); + } public UUID getOwnerUUID() { try { return this.getHandle().getOwnerUUID();