From 34e91b6e402c90fe60ec6cdcf2da07568a86cc9f Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 24 Feb 2018 01:16:01 -0500 Subject: [PATCH] Rename getOwnerUUID to Tameable#getOwnerUniqueId for consistency for the @kashike, thanks for adding a server diff to use this name! --- ... 0088-Tameable-getOwnerUniqueId-API.patch} | 12 +++--- .../0270-Tameable-getOwnerUniqueId-API.patch | 39 +++++++++++++++++++ 2 files changed, 44 insertions(+), 7 deletions(-) rename Spigot-API-Patches/{0088-Tameable-getOwnerUUID-API.patch => 0088-Tameable-getOwnerUniqueId-API.patch} (72%) create mode 100644 Spigot-Server-Patches/0270-Tameable-getOwnerUniqueId-API.patch diff --git a/Spigot-API-Patches/0088-Tameable-getOwnerUUID-API.patch b/Spigot-API-Patches/0088-Tameable-getOwnerUniqueId-API.patch similarity index 72% rename from Spigot-API-Patches/0088-Tameable-getOwnerUUID-API.patch rename to Spigot-API-Patches/0088-Tameable-getOwnerUniqueId-API.patch index a05bea9bbb..f692b36887 100644 --- a/Spigot-API-Patches/0088-Tameable-getOwnerUUID-API.patch +++ b/Spigot-API-Patches/0088-Tameable-getOwnerUniqueId-API.patch @@ -1,15 +1,13 @@ -From 1b21a306325785672427eff46c73ddc51a8275db Mon Sep 17 00:00:00 2001 +From d3a0a6fbeca31ad336ecf6c6939d021161e0edad Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 24 Feb 2018 00:55:52 -0500 -Subject: [PATCH] Tameable#getOwnerUUID API +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. -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 +index 44497aa3..0987c1e8 100644 --- a/src/main/java/org/bukkit/entity/Tameable.java +++ b/src/main/java/org/bukkit/entity/Tameable.java @@ -23,9 +23,21 @@ public interface Tameable extends Entity { @@ -22,13 +20,13 @@ index 44497aa3..447628a8 100644 + * + * @return the owners UUID, or null if not owned + */ -+ public java.util.UUID getOwnerUUID(); ++ public java.util.UUID getOwnerUniqueId(); + // Paper end + /** * Gets the current owning AnimalTamer * -+ * @see #getOwnerUUID() Recommended to use UUID version instead of this for performance. ++ * @see #getOwnerUniqueId() 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 diff --git a/Spigot-Server-Patches/0270-Tameable-getOwnerUniqueId-API.patch b/Spigot-Server-Patches/0270-Tameable-getOwnerUniqueId-API.patch new file mode 100644 index 0000000000..6de5f2177b --- /dev/null +++ b/Spigot-Server-Patches/0270-Tameable-getOwnerUniqueId-API.patch @@ -0,0 +1,39 @@ +From 8c67163e5c0e98e219b1bbe28eb7dfbc9685c1d2 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. + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +index e56bef334..cc9d432e7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +@@ -83,6 +83,9 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac + } + } + ++ public UUID getOwnerUniqueId() { ++ return getOwnerUUID(); ++ } + public UUID getOwnerUUID() { + return getHandle().getOwnerUUID(); + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java +index eaaebeab8..2e959321b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java +@@ -18,6 +18,9 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat + return (EntityTameableAnimal)super.getHandle(); + } + ++ public UUID getOwnerUniqueId() { ++ return getOwnerUUID(); ++ } + public UUID getOwnerUUID() { + try { + return getHandle().getOwnerUUID(); +-- +2.16.1 +