private void TryBouncingBlocks(bool Falling)
{
if ((double)this.velocity.Y < 5.0 && (double)this.velocity.Y > -5.0 || this.wet)
return;
int num = 0;
bool flag = false;
foreach (Point point in this.TouchedTiles)
{
Tile tile = Main.tile[point.X, point.Y];
if (tile != null && tile.active() && (tile.nactive() && Main.tileBouncy[(int)tile.type]))
{
flag = true;
num = point.Y;
break;
}
}
if (!flag)
return;
this.velocity.Y *= -0.8f;
if (this.controlJump)
this.velocity.Y = MathHelper.Clamp(this.velocity.Y, -13f, 13f);
this.position.Y = (float)(num * 16 - ((double)this.velocity.Y < 0.0 ? this.height : -16));
this.FloorVisuals(Falling);
this.velocity.Y = MathHelper.Clamp(this.velocity.Y, -20f, 20f);
if ((double)this.velocity.Y * (double)this.gravDir >= 0.0)
return;
this.fallStart = (int)this.position.Y / 16;
}