2019-03-20 01:28:15 +01:00
|
|
|
From ec25fb2dc8987362a3aa99baf07baa8fd2a79ba9 Mon Sep 17 00:00:00 2001
|
2018-02-24 06:57:03 +01:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sat, 24 Feb 2018 00:55:52 -0500
|
2018-02-24 07:16:01 +01:00
|
|
|
Subject: [PATCH] Tameable#getOwnerUniqueId API
|
2018-02-24 06:57:03 +01:00
|
|
|
|
|
|
|
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/entity/Tameable.java b/src/main/java/org/bukkit/entity/Tameable.java
|
2019-03-20 01:28:15 +01:00
|
|
|
index 0c066bdfc..be436f8df 100644
|
2018-02-24 06:57:03 +01:00
|
|
|
--- a/src/main/java/org/bukkit/entity/Tameable.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/Tameable.java
|
2019-03-20 01:28:15 +01:00
|
|
|
@@ -1,5 +1,6 @@
|
|
|
|
package org.bukkit.entity;
|
|
|
|
|
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
|
|
|
|
public interface Tameable extends Entity {
|
|
|
|
@@ -25,9 +26,22 @@ public interface Tameable extends Entity {
|
2018-02-24 06:57:03 +01:00
|
|
|
*/
|
|
|
|
public void setTamed(boolean tame);
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ /**
|
|
|
|
+ * Gets the owners UUID
|
|
|
|
+ *
|
|
|
|
+ * @return the owners UUID, or null if not owned
|
|
|
|
+ */
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
2018-02-24 07:16:01 +01:00
|
|
|
+ public java.util.UUID getOwnerUniqueId();
|
2018-02-24 06:57:03 +01:00
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* Gets the current owning AnimalTamer
|
|
|
|
*
|
2018-02-24 07:16:01 +01:00
|
|
|
+ * @see #getOwnerUniqueId() Recommended to use UUID version instead of this for performance.
|
2018-02-24 06:57:03 +01:00
|
|
|
+ * 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
|
|
|
|
*/
|
2019-03-20 01:28:15 +01:00
|
|
|
@Nullable
|
2018-02-24 06:57:03 +01:00
|
|
|
--
|
2019-03-20 01:28:15 +01:00
|
|
|
2.21.0
|
2018-02-24 06:57:03 +01:00
|
|
|
|