sets the players height back to normal after doing things like sleeping and dieing
()
| 1152 | * sets the players height back to normal after doing things like sleeping and dieing |
| 1153 | */ |
| 1154 | protected void resetHeight() |
| 1155 | { |
| 1156 | float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F; |
| 1157 | |
| 1158 | if (f > 1.0F) |
| 1159 | { |
| 1160 | f = 1.0F; |
| 1161 | } |
| 1162 | |
| 1163 | this.playSound(this.getSplashSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); |
| 1164 | float f1 = (float)MathHelper.floor_double(this.getEntityBoundingBox().minY); |
| 1165 | |
| 1166 | for (int i = 0; (float)i < 1.0F + this.width * 20.0F; ++i) |
| 1167 | { |
| 1168 | float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; |
| 1169 | float f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; |
| 1170 | this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + (double)f2, f1 + 1.0F, this.posZ + (double)f3, this.motionX, this.motionY - (double)(this.rand.nextFloat() * 0.2F), this.motionZ, new int[0]); |
| 1171 | } |
| 1172 | |
| 1173 | for (int j = 0; (float)j < 1.0F + this.width * 20.0F; ++j) |
| 1174 | { |
| 1175 | float f4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; |
| 1176 | float f5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; |
| 1177 | this.worldObj.spawnParticle(EnumParticleTypes.WATER_SPLASH, this.posX + (double)f4, f1 + 1.0F, this.posZ + (double)f5, this.motionX, this.motionY, this.motionZ, new int[0]); |
| 1178 | } |
| 1179 | } |
| 1180 | |
| 1181 | /** |
| 1182 | * Attempts to create sprinting particles if the entity is sprinting and not in water. |
no test coverage detected