aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0196-Tameable-getOwnerUniqueId-API.patch
blob: d27adf73e126b7bff73109c6b37e8a15683c0d33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 9952db3eb5ba94547f5e786c473fb59dfec616ab..1aea5f3f05794b444ca592cf518e29f76ccbd397 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
@@ -90,6 +90,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 bff9854f3088649e6718ba8096abb170915f9d84..286d1194f2d46a8715a095ecaed276f657e5214b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
@@ -17,6 +17,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();