Paper/patches/server/0171-Tameable-getOwnerUniqueId-API.patch

39 lines
1.7 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02: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
2024-04-24 04:21:40 +02:00
index 5192fa2aeba7833fca456bded0deedde7de03506..3952e52b94c1cc97e1d2d3885f59d7690efb74ad 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
@@ -88,6 +88,10 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
2021-06-11 14:02:28 +02:00
}
}
2021-06-12 18:56:13 +02:00
+ @Override
2021-06-11 14:02:28 +02:00
+ public UUID getOwnerUniqueId() {
+ return getOwnerUUID();
+ }
public UUID getOwnerUUID() {
2021-06-12 18:56:13 +02:00
return this.getHandle().getOwnerUUID();
2021-06-11 14:02:28 +02:00
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
2024-04-24 04:21:40 +02:00
index 3d19a077db7bb1e24811cede3ad958731050359f..cedb8e67e208cdf954d052a4f0a100c1c07a962b 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
2021-06-12 18:56:13 +02:00
@@ -17,6 +17,10 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat
2021-06-11 14:02:28 +02:00
return (TamableAnimal) super.getHandle();
}
2021-06-12 18:56:13 +02:00
+ @Override
2021-06-11 14:02:28 +02:00
+ public UUID getOwnerUniqueId() {
+ return getOwnerUUID();
+ }
public UUID getOwnerUUID() {
try {
2021-06-12 18:56:13 +02:00
return this.getHandle().getOwnerUUID();