From 30a6337982e876e6010eecc9ccb3785fc9fe121d Mon Sep 17 00:00:00 2001 From: blablubbabc Date: Sat, 15 Jun 2019 03:39:04 +0200 Subject: [PATCH] SPIGOT-5010: World#getEntitiesByClass/es also return entities in border chunks. --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index b5052e1a1e..6091f1a34f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -861,7 +861,7 @@ public class CraftWorld implements World { Class bukkitClass = bukkitEntity.getClass(); - if (clazz.isAssignableFrom(bukkitClass)) { + if (clazz.isAssignableFrom(bukkitClass) && bukkitEntity.isValid()) { list.add((T) bukkitEntity); } } @@ -885,7 +885,7 @@ public class CraftWorld implements World { Class bukkitClass = bukkitEntity.getClass(); for (Class clazz : classes) { - if (clazz.isAssignableFrom(bukkitClass)) { + if (clazz.isAssignableFrom(bukkitClass) && bukkitEntity.isValid()) { list.add(bukkitEntity); break; }