Program: 22480
Project: 22480
Buggy source:
/** 
 * Called to update the entity's position/logic.
 */
public void onUpdate(){
  super.onUpdate();
  if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
    float var1=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
    this.prevRotationYaw=this.rotationYaw=(float)(Math.atan2(this.motionX,this.motionZ) * 180.0D / Math.PI);
    this.prevRotationPitch=this.rotationPitch=(float)(Math.atan2(this.motionY,(double)var1) * 180.0D / Math.PI);
  }
  Block var16=this.worldObj.getBlock(this.xTile,this.yTile,this.zTile);
  if (var16 != Blocks.air && var16 != null) {
    var16.setBlockBoundsBasedOnState(this.worldObj,this.xTile,this.yTile,this.zTile);
    AxisAlignedBB var2=var16.getCollisionBoundingBoxFromPool(this.worldObj,this.xTile,this.yTile,this.zTile);
    if (var2 != null && var2.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX,this.posY,this.posZ))) {
      this.inGround=true;
    }
  }
  if (this.arrowShake > 0) {
    --this.arrowShake;
  }
  if (this.inGround) {
    Block var18=this.worldObj.getBlock(this.xTile,this.yTile,this.zTile);
    int var19=this.worldObj.getBlockMetadata(this.xTile,this.yTile,this.zTile);
    if (var18 == this.inTile && var19 == this.inData) {
      ++this.ticksInGround;
      if (this.ticksInGround == 1) {
        this.setDead();
      }
    }
 else {
      this.inGround=false;
      this.motionX*=(double)(this.rand.nextFloat() * 0.2F);
      this.motionY*=(double)(this.rand.nextFloat() * 0.2F);
      this.motionZ*=(double)(this.rand.nextFloat() * 0.2F);
      this.ticksInGround=0;
      this.ticksInAir=0;
    }
  }
 else {
    ++this.ticksInAir;
    Vec3 var17=this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX,this.posY,this.posZ);
    Vec3 var3=this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX,this.posY + this.motionY,this.posZ + this.motionZ);
    MovingObjectPosition var4=this.worldObj.rayTraceBlocks(var17,var3,false);
    var17=this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX,this.posY,this.posZ);
    var3=this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX,this.posY + this.motionY,this.posZ + this.motionZ);
    if (var4 != null) {
      var3=this.worldObj.getWorldVec3Pool().getVecFromPool(var4.hitVec.xCoord,var4.hitVec.yCoord,var4.hitVec.zCoord);
    }
    Entity var5=null;
    List var6=this.worldObj.getEntitiesWithinAABBExcludingEntity(this,this.boundingBox.addCoord(this.motionX,this.motionY,this.motionZ).expand(1.0D,1.0D,1.0D));
    double var7=0.0D;
    int var9;
    float var11;
    for (var9=0; var9 < var6.size(); ++var9) {
      Entity var10=(Entity)var6.get(var9);
      if (var10.canBeCollidedWith() && (var10 != this.shootingEntity || this.ticksInAir >= 5)) {
        var11=0.3F;
        AxisAlignedBB var12=var10.boundingBox.expand((double)var11,(double)var11,(double)var11);
        MovingObjectPosition var13=var12.calculateIntercept(var17,var3);
        if (var13 != null) {
          double var14=var17.distanceTo(var13.hitVec);
          if (var14 < var7 || var7 == 0.0D) {
            var5=var10;
            var7=var14;
          }
        }
      }
    }
    if (var5 != null) {
      var4=new MovingObjectPosition(var5);
    }
    float var20;
    float var26;
    if (var4 != null) {
      if (var4.entityHit != null) {
        var20=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
        int var23=(int)this.damage;
        DamageSource var21=null;
        if (this.shootingEntity == null) {
          var21=DamageSource.causeThrownDamage(this,this);
        }
 else {
          var21=DamageSource.causeThrownDamage(this,this.shootingEntity);
        }
        if (this.isBurning() && !(var4.entityHit instanceof EntityEnderman)) {
          var4.entityHit.setFire(5);
        }
        if (var4.entityHit.attackEntityFrom(var21,var23)) {
          if (var4.entityHit instanceof EntityLiving) {
            EntityLiving var24=(EntityLiving)var4.entityHit;
            if (!this.worldObj.isRemote) {
              var24.setArrowCountInEntity(var24.getArrowCountInEntity() + 1);
            }
            if (this.knockbackStrength > 0) {
              var26=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
              if (var26 > 0.0F) {
              }
            }
            if (this.shootingEntity != null) {
            }
            if (this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) {
            }
          }
          if (!(var4.entityHit instanceof EntityEnderman)) {
            this.setDead();
          }
        }
 else {
          this.motionX*=-0.10000000149011612D;
          this.motionY*=-0.10000000149011612D;
          this.motionZ*=-0.10000000149011612D;
          this.rotationYaw+=180.0F;
          this.prevRotationYaw+=180.0F;
          this.ticksInAir=0;
        }
      }
 else {
        this.xTile=var4.blockX;
        this.yTile=var4.blockY;
        this.zTile=var4.blockZ;
        this.inTile=this.worldObj.getBlock(this.xTile,this.yTile,this.zTile);
        this.inData=this.worldObj.getBlockMetadata(this.xTile,this.yTile,this.zTile);
        this.motionX=(double)((float)(var4.hitVec.xCoord - this.posX));
        this.motionY=(double)((float)(var4.hitVec.yCoord - this.posY));
        this.motionZ=(double)((float)(var4.hitVec.zCoord - this.posZ));
        var20=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
        this.posX-=this.motionX / (double)var20 * 0.05000000074505806D;
        this.posY-=this.motionY / (double)var20 * 0.05000000074505806D;
        this.posZ-=this.motionZ / (double)var20 * 0.05000000074505806D;
        this.inGround=true;
        this.arrowShake=7;
        if (this.inTile != null) {
          this.inTile.onEntityCollidedWithBlock(this.worldObj,this.xTile,this.yTile,this.zTile,this);
        }
      }
    }
    this.posX+=this.motionX;
    this.posY+=this.motionY;
    this.posZ+=this.motionZ;
    var20=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
    this.rotationYaw=(float)(Math.atan2(this.motionX,this.motionZ) * 180.0D / Math.PI);
    for (this.rotationPitch=(float)(Math.atan2(this.motionY,(double)var20) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch-=360.0F) {
      ;
    }
    while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
      this.prevRotationPitch+=360.0F;
    }
    while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
      this.prevRotationYaw-=360.0F;
    }
    while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
      this.prevRotationYaw+=360.0F;
    }
    this.rotationPitch=this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
    this.rotationYaw=this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
    float var22=0.99F;
    var11=0.05F;
    if (this.isInWater()) {
      for (int var25=0; var25 < 4; ++var25) {
        var26=0.25F;
        this.worldObj.spawnParticle("String_Node_Str",this.posX - this.motionX * (double)var26,this.posY - this.motionY * (double)var26,this.posZ - this.motionZ * (double)var26,this.motionX,this.motionY,this.motionZ);
      }
      var22=0.8F;
    }
    this.motionX*=(double)var22;
    this.motionY*=(double)var22;
    this.motionZ*=(double)var22;
    this.motionY-=(double)var11;
    this.setPosition(this.posX,this.posY,this.posZ);
  }
}

Fixed version (ground truth):
/** 
 * Called to update the entity's position/logic.
 */
public void onUpdate(){
  super.onUpdate();
  if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
    float var1=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
    this.prevRotationYaw=this.rotationYaw=(float)(Math.atan2(this.motionX,this.motionZ) * 180.0D / Math.PI);
    this.prevRotationPitch=this.rotationPitch=(float)(Math.atan2(this.motionY,(double)var1) * 180.0D / Math.PI);
  }
  Block var16=this.worldObj.getBlock(this.xTile,this.yTile,this.zTile);
  if (var16 != Blocks.air && var16 != null) {
    var16.setBlockBoundsBasedOnState(this.worldObj,this.xTile,this.yTile,this.zTile);
    AxisAlignedBB var2=var16.getCollisionBoundingBoxFromPool(this.worldObj,this.xTile,this.yTile,this.zTile);
    if (var2 != null && var2.isVecInside(Vec3.createVectorHelper(this.posX,this.posY,this.posZ))) {
      this.inGround=true;
    }
  }
  if (this.arrowShake > 0) {
    --this.arrowShake;
  }
  if (this.inGround) {
    Block var18=this.worldObj.getBlock(this.xTile,this.yTile,this.zTile);
    int var19=this.worldObj.getBlockMetadata(this.xTile,this.yTile,this.zTile);
    if (var18 == this.inTile && var19 == this.inData) {
      ++this.ticksInGround;
      if (this.ticksInGround == 1) {
        this.setDead();
      }
    }
 else {
      this.inGround=false;
      this.motionX*=(double)(this.rand.nextFloat() * 0.2F);
      this.motionY*=(double)(this.rand.nextFloat() * 0.2F);
      this.motionZ*=(double)(this.rand.nextFloat() * 0.2F);
      this.ticksInGround=0;
      this.ticksInAir=0;
    }
  }
 else {
    ++this.ticksInAir;
    Vec3 var17=Vec3.createVectorHelper(this.posX,this.posY,this.posZ);
    Vec3 var3=Vec3.createVectorHelper(this.posX + this.motionX,this.posY + this.motionY,this.posZ + this.motionZ);
    MovingObjectPosition var4=this.worldObj.rayTraceBlocks(var17,var3,false);
    var17=Vec3.createVectorHelper(this.posX,this.posY,this.posZ);
    var3=Vec3.createVectorHelper(this.posX + this.motionX,this.posY + this.motionY,this.posZ + this.motionZ);
    if (var4 != null) {
      var3=Vec3.createVectorHelper(var4.hitVec.xCoord,var4.hitVec.yCoord,var4.hitVec.zCoord);
    }
    Entity var5=null;
    List var6=this.worldObj.getEntitiesWithinAABBExcludingEntity(this,this.boundingBox.addCoord(this.motionX,this.motionY,this.motionZ).expand(1.0D,1.0D,1.0D));
    double var7=0.0D;
    int var9;
    float var11;
    for (var9=0; var9 < var6.size(); ++var9) {
      Entity var10=(Entity)var6.get(var9);
      if (var10.canBeCollidedWith() && (var10 != this.shootingEntity || this.ticksInAir >= 5)) {
        var11=0.3F;
        AxisAlignedBB var12=var10.boundingBox.expand((double)var11,(double)var11,(double)var11);
        MovingObjectPosition var13=var12.calculateIntercept(var17,var3);
        if (var13 != null) {
          double var14=var17.distanceTo(var13.hitVec);
          if (var14 < var7 || var7 == 0.0D) {
            var5=var10;
            var7=var14;
          }
        }
      }
    }
    if (var5 != null) {
      var4=new MovingObjectPosition(var5);
    }
    float var20;
    float var26;
    if (var4 != null) {
      if (var4.entityHit != null) {
        var20=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
        int var23=(int)this.damage;
        DamageSource var21=null;
        if (this.shootingEntity == null) {
          var21=DamageSource.causeThrownDamage(this,this);
        }
 else {
          var21=DamageSource.causeThrownDamage(this,this.shootingEntity);
        }
        if (this.isBurning() && !(var4.entityHit instanceof EntityEnderman)) {
          var4.entityHit.setFire(5);
        }
        if (var4.entityHit.attackEntityFrom(var21,var23)) {
          if (var4.entityHit instanceof EntityLiving) {
            EntityLiving var24=(EntityLiving)var4.entityHit;
            if (!this.worldObj.isRemote) {
              var24.setArrowCountInEntity(var24.getArrowCountInEntity() + 1);
            }
            if (this.knockbackStrength > 0) {
              var26=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
              if (var26 > 0.0F) {
              }
            }
            if (this.shootingEntity != null) {
            }
            if (this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) {
            }
          }
          if (!(var4.entityHit instanceof EntityEnderman)) {
            this.setDead();
          }
        }
 else {
          this.motionX*=-0.10000000149011612D;
          this.motionY*=-0.10000000149011612D;
          this.motionZ*=-0.10000000149011612D;
          this.rotationYaw+=180.0F;
          this.prevRotationYaw+=180.0F;
          this.ticksInAir=0;
        }
      }
 else {
        this.xTile=var4.blockX;
        this.yTile=var4.blockY;
        this.zTile=var4.blockZ;
        this.inTile=this.worldObj.getBlock(this.xTile,this.yTile,this.zTile);
        this.inData=this.worldObj.getBlockMetadata(this.xTile,this.yTile,this.zTile);
        this.motionX=(double)((float)(var4.hitVec.xCoord - this.posX));
        this.motionY=(double)((float)(var4.hitVec.yCoord - this.posY));
        this.motionZ=(double)((float)(var4.hitVec.zCoord - this.posZ));
        var20=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
        this.posX-=this.motionX / (double)var20 * 0.05000000074505806D;
        this.posY-=this.motionY / (double)var20 * 0.05000000074505806D;
        this.posZ-=this.motionZ / (double)var20 * 0.05000000074505806D;
        this.inGround=true;
        this.arrowShake=7;
        if (this.inTile != null) {
          this.inTile.onEntityCollidedWithBlock(this.worldObj,this.xTile,this.yTile,this.zTile,this);
        }
      }
    }
    this.posX+=this.motionX;
    this.posY+=this.motionY;
    this.posZ+=this.motionZ;
    var20=MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
    this.rotationYaw=(float)(Math.atan2(this.motionX,this.motionZ) * 180.0D / Math.PI);
    for (this.rotationPitch=(float)(Math.atan2(this.motionY,(double)var20) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch-=360.0F) {
      ;
    }
    while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
      this.prevRotationPitch+=360.0F;
    }
    while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
      this.prevRotationYaw-=360.0F;
    }
    while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
      this.prevRotationYaw+=360.0F;
    }
    this.rotationPitch=this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
    this.rotationYaw=this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
    float var22=0.99F;
    var11=0.05F;
    if (this.isInWater()) {
      for (int var25=0; var25 < 4; ++var25) {
        var26=0.25F;
        this.worldObj.spawnParticle("String_Node_Str",this.posX - this.motionX * (double)var26,this.posY - this.motionY * (double)var26,this.posZ - this.motionZ * (double)var26,this.motionX,this.motionY,this.motionZ);
      }
      var22=0.8F;
    }
    this.motionX*=(double)var22;
    this.motionY*=(double)var22;
    this.motionZ*=(double)var22;
    this.motionY-=(double)var11;
    this.setPosition(this.posX,this.posY,this.posZ);
  }
}