d11 = 50D;
}
if (d11 < -50D) {
d11 = -50D;
}
Vec3D vec3d = Vec3D.createVector(targetX - posX, targetY - posY,
targetZ - posZ).normalize();
Vec3D vec3d1 = Vec3D.createVector(
MathHelper.sin((rotationYaw * 3.141593F) / 180F), motionY,
-MathHelper.cos((rotationYaw * 3.141593F) / 180F))
.normalize();
float f18 = (float) (vec3d1.dotProduct(vec3d) + 0.5D) / 1.5F;
if (f18 < 0.0F) {
f18 = 0.0F;
}
randomYawVelocity *= 0.8F;
float f19 = MathHelper.sqrt_double(motionX * motionX + motionZ
* motionZ) * 1.0F + 1.0F;
double d14 = Math.sqrt(motionX * motionX + motionZ * motionZ) * 1.0D + 1.0D;
if (d14 > 40D) {
d14 = 40D;
}
randomYawVelocity += d11
* (0.69999998807907104D / d14 / (double) f19);
rotationYaw += randomYawVelocity * 0.1F;
float f20 = (float) (2D / (d14 + 1.0D));
float f21 = 0.06F;
moveFlying(0.0F, -1F, f21 * (f18 * f20 + (1.0F - f20)));
if (differentMotion) {
moveEntity(motionX * 0.80000001192092896D,
motionY * 0.80000001192092896D,
motionZ * 0.80000001192092896D);
} else {
moveEntity(motionX, motionY, motionZ);
}
Vec3D vec3d2 = Vec3D.createVector(motionX, motionY, motionZ)
.normalize();
float f22 = (float) (vec3d2.dotProduct(vec3d1) + 1.0D) / 2.0F;
f22 = 0.8F + 0.15F * f22;
motionX *= f22;
motionZ *= f22;
motionY *= 0.9100000262260437D;
renderYawOffset = rotationYaw;