From 59b32ee3f35b2b8d55337df9a86f2b480e23c39d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 3 Jan 2017 22:40:31 -0600 Subject: SPIGOT-826: Add method to retrieve entity by UUID --- src/main/java/org/bukkit/Bukkit.java | 10 ++++++++++ src/main/java/org/bukkit/Server.java | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index ce6b761d..cadbbcad 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/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/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index c25fe223..4c03a997 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/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 -- cgit v1.2.3