3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00
Paper/Spigot-API-Patches/0085-Tameable-getOwnerUniqueId-API.patch
Spottedleaf 2f782a6652 Updated Upstream (CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
17543ecf SPIGOT-5035: Error Using Virtual Merchant GUI
0fc6922b SPIGOT-5028: Villager#setVillagerExperience() doesn't work
bdbdbe44 SPIGOT-5024: Fox error - Unknown target reason
2019-06-06 16:56:51 +01:00

46 Zeilen
1.4 KiB
Diff

From 5ce17867715b109030f8d6e968ce082239cf26a2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 24 Feb 2018 00:55:52 -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/entity/Tameable.java b/src/main/java/org/bukkit/entity/Tameable.java
index 0c066bdfc..be436f8df 100644
--- a/src/main/java/org/bukkit/entity/Tameable.java
+++ b/src/main/java/org/bukkit/entity/Tameable.java
@@ -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 {
*/
public void setTamed(boolean tame);
+ // Paper start
+ /**
+ * Gets the owners UUID
+ *
+ * @return the owners UUID, or null if not owned
+ */
+ @NotNull
+ public java.util.UUID getOwnerUniqueId();
+ // Paper end
+
/**
* Gets the current owning AnimalTamer
*
+ * @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
*/
@Nullable
--
2.21.0