From 3b2d6fd59e100a70479b5ce8300f571ae596d760 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 30 Mar 2016 21:56:07 -0400 Subject: [PATCH] add null check to getEntity API --- .../0122-Add-getEntity-by-UUID-API.patch | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Spigot-Server-Patches/0122-Add-getEntity-by-UUID-API.patch b/Spigot-Server-Patches/0122-Add-getEntity-by-UUID-API.patch index c85b9c09a..39d03f1b6 100644 --- a/Spigot-Server-Patches/0122-Add-getEntity-by-UUID-API.patch +++ b/Spigot-Server-Patches/0122-Add-getEntity-by-UUID-API.patch @@ -1,14 +1,14 @@ -From 88d6d362e1437fc065603bbbb558448ff2443d52 Mon Sep 17 00:00:00 2001 +From d229df3e11a546bfc6fc7016a72633c4efbcec02 Mon Sep 17 00:00:00 2001 From: DemonWav Date: Wed, 30 Mar 2016 01:20:11 -0500 Subject: [PATCH] Add getEntity by UUID API diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 058735e..0c037ff 100644 +index 058735e..06dec17 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1622,4 +1622,17 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -1622,4 +1622,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs return (Bukkit.getServer() instanceof CraftServer) ? ((CraftServer) Bukkit.getServer()).getServer() : null; } // CraftBukkit end @@ -17,6 +17,9 @@ index 058735e..0c037ff 100644 + public Entity getEntity(UUID uuid) { + Entity entity; + for (WorldServer world : worldServer) { ++ if (world == null) { ++ continue; ++ } + entity = world.getEntity(uuid); + if (entity != null && !entity.dead) { + return entity;