d10 += 1.0D / b0;
}
}
if (!this.worldObj.isRemote && d10 > 0.0D) {
WorldServer worldserver = (WorldServer) this.worldObj;
int k = 1;
if (this.rand.nextFloat() < 0.25F
&& this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1,
MathHelper.floor_double(this.posZ))) {
k = 2;
}
if (this.rand.nextFloat() < 0.5F
&& !this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1,
MathHelper.floor_double(this.posZ))) {
--k;
}
if (this.field_146045_ax > 0) {
--this.field_146045_ax;
if (this.field_146045_ax <= 0) {
this.field_146040_ay = 0;
this.field_146038_az = 0;
}
} else {
float f1;
float f2;
double d5;
double d6;
float f7;
double d11;
if (this.field_146038_az > 0) {
this.field_146038_az -= k;
if (this.field_146038_az <= 0) {
this.motionY -= 0.20000000298023224D;
this.playSound("random.splash", 0.25F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F);
f1 = MathHelper.floor_double(this.boundingBox.minY);
worldserver.func_147487_a("bubble", this.posX, f1 + 1.0F, this.posZ, (int) (1.0F + this.width * 20.0F), this.width, 0.0D,
this.width, 0.20000000298023224D);
worldserver.func_147487_a("wake", this.posX, f1 + 1.0F, this.posZ, (int) (1.0F + this.width * 20.0F), this.width, 0.0D,
this.width, 0.20000000298023224D);
this.field_146045_ax = MathHelper.getRandomIntegerInRange(this.rand, 10, 30);
} else {
this.field_146054_aA = (float) (this.field_146054_aA + this.rand.nextGaussian() * 4.0D);
f1 = this.field_146054_aA * 0.017453292F;
f7 = MathHelper.sin(f1);
f2 = MathHelper.cos(f1);
d11 = this.posX + f7 * this.field_146038_az * 0.1F;
d5 = MathHelper.floor_double(this.boundingBox.minY) + 1.0F;
d6 = this.posZ + f2 * this.field_146038_az * 0.1F;
if (this.rand.nextFloat() < 0.15F) {
worldserver.func_147487_a("bubble", d11, d5 - 0.10000000149011612D, d6, 1, f7, 0.1D, f2, 0.0D);
}
float f3 = f7 * 0.04F;
float f4 = f2 * 0.04F;
worldserver.func_147487_a("wake", d11, d5, d6, 0, f4, 0.01D, (-f3), 1.0D);
worldserver.func_147487_a("wake", d11, d5, d6, 0, (-f4), 0.01D, f3, 1.0D);
}
} else if (this.field_146040_ay > 0) {
this.field_146040_ay -= k;
f1 = 0.15F;
if (this.field_146040_ay < 20) {
f1 = (float) (f1 + (20 - this.field_146040_ay) * 0.05D);
} else if (this.field_146040_ay < 40) {
f1 = (float) (f1 + (40 - this.field_146040_ay) * 0.02D);
} else if (this.field_146040_ay < 60) {
f1 = (float) (f1 + (60 - this.field_146040_ay) * 0.01D);
}
if (this.rand.nextFloat() < f1) {
f7 = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F) * 0.017453292F;
f2 = MathHelper.randomFloatClamp(this.rand, 25.0F, 60.0F);
d11 = this.posX + MathHelper.sin(f7) * f2 * 0.1F;
d5 = MathHelper.floor_double(this.boundingBox.minY) + 1.0F;
d6 = this.posZ + MathHelper.cos(f7) * f2 * 0.1F;
worldserver.func_147487_a("splash", d11, d5, d6, 2 + this.rand.nextInt(2), 0.10000000149011612D, 0.0D, 0.10000000149011612D,
0.0D);
}
if (this.field_146040_ay <= 0) {
this.field_146054_aA = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F);