testserver/patches/server/0174-Tameable-getOwnerUniqu...

39 lines
1.7 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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 a5202ee012034678efbbd5ca1eccf2fd72a315bd..254d4f2e45d7c8f572a4368eccd84560d4d0d836 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
2021-06-12 16:56:13 +00:00
@@ -89,6 +89,10 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
2021-06-11 12:02:28 +00:00
}
}
2021-06-12 16:56:13 +00:00
+ @Override
2021-06-11 12:02:28 +00:00
+ public UUID getOwnerUniqueId() {
+ return getOwnerUUID();
+ }
public UUID getOwnerUUID() {
2021-06-12 16:56:13 +00:00
return this.getHandle().getOwnerUUID();
2021-06-11 12:02:28 +00:00
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
2021-11-23 14:03:50 +00:00
index f225da459d0c9b5b5322ba3256e63880a7b4ad5d..428437970cac144be53cd0e30af7af0cd1ce603b 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
2021-06-12 16:56:13 +00:00
@@ -17,6 +17,10 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat
2021-06-11 12:02:28 +00:00
return (TamableAnimal) super.getHandle();
}
2021-06-12 16:56:13 +00:00
+ @Override
2021-06-11 12:02:28 +00:00
+ public UUID getOwnerUniqueId() {
+ return getOwnerUUID();
+ }
public UUID getOwnerUUID() {
try {
2021-06-12 16:56:13 +00:00
return this.getHandle().getOwnerUUID();