Not calculating entity collisions for arrows in first 3 ticks of its life

This commit is contained in:
Konstantin Shandurenko 2021-02-22 14:58:26 +03:00
parent 714e107eb3
commit 6e23552d9a

View File

@ -90,6 +90,9 @@ public class EntityAbstractArrow extends ObjectEntity implements Projectile {
.filter(entity -> entity instanceof LivingEntity)
.collect(Collectors.toSet());
}
if (getAliveTicks() < 3) {
continue;
}
Optional<Entity> victimOptional = entities.stream()
.filter(entity -> entity.getBoundingBox().intersect(pos.getX(), pos.getY(), pos.getZ()))
.findAny();