From d285cd80738a0a447e8a8508e43959458491b5ef Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 24 Feb 2018 00:57:03 -0500 Subject: [PATCH] Tameable#getOwnerUUID API This is faster if all you need is the UUID, as .getOwner() will cause an OfflinePlayer to be loaded from disk. This method is already implemented on the server, just needed to expose it. --- .../Tameable-getOwnerUUID-API.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Spigot-API-Patches/Tameable-getOwnerUUID-API.patch diff --git a/Spigot-API-Patches/Tameable-getOwnerUUID-API.patch b/Spigot-API-Patches/Tameable-getOwnerUUID-API.patch new file mode 100644 index 0000000000..636d15fdea --- /dev/null +++ b/Spigot-API-Patches/Tameable-getOwnerUUID-API.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sat, 24 Feb 2018 00:55:52 -0500 +Subject: [PATCH] Tameable#getOwnerUUID API + +This is faster if all you need is the UUID, as .getOwner() will cause +an OfflinePlayer to be loaded from disk. + +This method is already implemented on the server, just needed to expose it. + +diff --git a/src/main/java/org/bukkit/entity/Tameable.java b/src/main/java/org/bukkit/entity/Tameable.java +index 44497aa3..447628a8 100644 +--- a/src/main/java/org/bukkit/entity/Tameable.java ++++ b/src/main/java/org/bukkit/entity/Tameable.java +@@ -0,0 +0,0 @@ public interface Tameable extends Entity { + */ + public void setTamed(boolean tame); + ++ // Paper start ++ /** ++ * Gets the owners UUID ++ * ++ * @return the owners UUID, or null if not owned ++ */ ++ public java.util.UUID getOwnerUUID(); ++ // Paper end ++ + /** + * Gets the current owning AnimalTamer + * ++ * @see #getOwnerUUID() Recommended to use UUID version instead of this for performance. ++ * This method will cause OfflinePlayer to be loaded from disk if the owner is not online. ++ * + * @return the owning AnimalTamer, or null if not owned + */ + public AnimalTamer getOwner(); +-- \ No newline at end of file