Optimize getEntitiesByClasses slightly

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
CraftBukkit/Spigot 2019-06-16 11:13:42 +10:00
parent 700f1c0ef8
commit 260bd8c7c4

View file

@ -885,8 +885,10 @@ public class CraftWorld implements World {
Class<?> bukkitClass = bukkitEntity.getClass();
for (Class<?> clazz : classes) {
if (clazz.isAssignableFrom(bukkitClass) && bukkitEntity.isValid()) {
list.add(bukkitEntity);
if (clazz.isAssignableFrom(bukkitClass)) {
if (bukkitEntity.isValid()) {
list.add(bukkitEntity);
}
break;
}
}