SPIGOT-5010: World#getEntitiesByClass/es also return entities in border chunks.

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
CraftBukkit/Spigot 2019-06-15 03:39:04 +02:00
parent c1cc0cddf5
commit d53dd95127

View File

@ -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;
}