@Nullable private RayTraceResult checkEntityCollision(final World world, final Vec3d start, final Vec3d target) { RayTraceResult entityHit = null; double bestSqrDistance = Double.POSITIVE_INFINITY; final List<Entity> collisions = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ)); for (final Entity entity : collisions) { if (entity.canBeCollidedWith()) { final AxisAlignedBB entityBounds = entity.getEntityBoundingBox(); final RayTraceResult hit = entityBounds.calculateIntercept(start, target); if (hit != null) { final double sqrDistance = start.squareDistanceTo(hit.hitVec); if (sqrDistance < bestSqrDistance) { hit.entityHit = entity; hit.typeOfHit = RayTraceResult.Type.ENTITY; entityHit = hit; bestSqrDistance = sqrDistance; } } } } return entityHit; }
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ).expandXyz(1.0D)); double d0 = 0.0D;
List<Entity> list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ).expandXyz(1.0D)); double d0 = 0.0D;
Vec3d vec33 = null; Entity pointedEntity = null; List<Entity> list = mc.world.getEntitiesInAABBexcluding(mc.getRenderViewEntity(), mc.getRenderViewEntity().getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand(1.0D, 1.0D, 1.0D), Predicates.and(new Predicate<Entity>() { @Override public boolean apply(@Nullable Entity input) {