Optimize getEntitiesByClasses slightly

This commit is contained in:
blablubbabc 2019-06-16 11:13:42 +10:00 committed by md_5
parent e81013d786
commit f424222672

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