prevRotationPitch = rotationPitch = (float) ((Math.atan2(motionY, f) * 180D) / 3.1415927410125732D);
}
int i = worldObj.getBlockId(xTile, yTile, zTile);
if (i > 0) {
Block.blocksList[i].setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile);
AxisAlignedBB axisalignedbb = Block.blocksList[i].getCollisionBoundingBoxFromPool(
worldObj, xTile, yTile, zTile);
if (axisalignedbb != null
&& axisalignedbb.isVecInside(Vec3D.createVector(posX, posY, posZ))) {
inGround = true;
}
}
if (arrowShake > 0) {
arrowShake--;
}
if (inGround) {
int j = worldObj.getBlockId(xTile, yTile, zTile);
int k = worldObj.getBlockMetadata(xTile, yTile, zTile);
if (j != inTile || k != inData) {
inGround = false;
motionX *= rand.nextFloat() * 0.2F;
motionY *= rand.nextFloat() * 0.2F;
motionZ *= rand.nextFloat() * 0.2F;
ticksInGround = 0;
ticksInAir = 0;
return;
}
ticksInGround++;
if (ticksInGround == 1200) {
setDead();
}
return;
}
ticksInAir++;
Vec3D vec3d = Vec3D.createVector(posX, posY, posZ);
Vec3D vec3d1 = Vec3D.createVector(posX + motionX, posY + motionY, posZ + motionZ);
MovingObjectPosition movingobjectposition = worldObj.rayTraceBlocks_do_do(vec3d, vec3d1,
false, true);
vec3d = Vec3D.createVector(posX, posY, posZ);
vec3d1 = Vec3D.createVector(posX + motionX, posY + motionY, posZ + motionZ);
if (movingobjectposition != null) {
vec3d1 = Vec3D.createVector(movingobjectposition.hitVec.xCoord,
movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = worldObj.getEntitiesWithinAABBExcludingEntity(this,
boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
double d = 0.0D;
for (int l = 0; l < list.size(); l++) {
Entity entity1 = (Entity) list.get(l);
if (!entity1.canBeCollidedWith() || entity1 == shootingEntity && ticksInAir < 5) {
continue;
}
float f5 = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f5, f5, f5);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3d,
vec3d1);
if (movingobjectposition1 == null) {
continue;
}
double d1 = vec3d.distanceTo(movingobjectposition1.hitVec);