From 596839ddb52a274dfb18d12e500c72774e0c278a Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 3 Jan 2017 22:40:31 -0600 Subject: [PATCH] SPIGOT-826: Add method to retrieve entity by UUID By: Zach Brown --- paper-api/src/main/java/org/bukkit/Bukkit.java | 10 ++++++++++ paper-api/src/main/java/org/bukkit/Server.java | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index ce6b761daf..cadbbcad00 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -1141,6 +1141,16 @@ public final class Bukkit { return server.createBossBar(title, color, style, flags); } + /** + * Gets an entity on the server by its UUID + * + * @param uuid the UUID of the entity + * @return the entity with the given UUID, or null if it isn't found + */ + public static Entity getEntity(UUID uuid) { + return server.getEntity(uuid); + } + /** * @see UnsafeValues * @return the unsafe values instance diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index c25fe2236a..4c03a9971a 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -935,6 +935,14 @@ public interface Server extends PluginMessageRecipient { */ BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag ...flags); + /** + * Gets an entity on the server by its UUID + * + * @param uuid the UUID of the entity + * @return the entity with the given UUID, or null if it isn't found + */ + Entity getEntity(UUID uuid); + /** * @see UnsafeValues * @return the unsafe values instance