protected boolean func_48376_a(EntityLiving par1EntityLiving, boolean par2) {
    if (par1EntityLiving == null) {
      return false;
    } else if (par1EntityLiving == this.taskOwner) {
      return false;
    } else if (!par1EntityLiving.isEntityAlive()) {
      return false;
    } else {
      if (!this.taskOwner.func_48100_a(par1EntityLiving.getClass())) {
        return false;
      } else {
        if (this.taskOwner instanceof EntityTameable
            && ((EntityTameable) this.taskOwner).isTamed()) {
          if (par1EntityLiving instanceof EntityTameable
              && ((EntityTameable) par1EntityLiving).isTamed()) {
            return false;
          }

          if (par1EntityLiving == ((EntityTameable) this.taskOwner).getOwner()) {
            return false;
          }
        } else if (par1EntityLiving instanceof EntityPlayer
            && !par2 /*&& ((EntityPlayer)par1EntityLiving).capabilities.disableDamage*/) {
          return false;
        }

        if (!this.taskOwner.isWithinHomeDistance(
            MathHelper.floor_double(par1EntityLiving.posX),
            MathHelper.floor_double(par1EntityLiving.posY),
            MathHelper.floor_double(par1EntityLiving.posZ))) {
          return false;
        } else if (this.field_48380_e
            && !this.taskOwner.getEntitySenses().canSee(par1EntityLiving)) {
          return false;
        } else {
          if (this.field_48383_a) {
            if (--this.field_48377_f <= 0) {
              this.field_48381_b = 0;
            }

            if (this.field_48381_b == 0) {
              this.field_48381_b = this.func_48375_a(par1EntityLiving) ? 1 : 2;
            }

            if (this.field_48381_b == 2) {
              return false;
            }
          }

          return true;
        }
      }
    }
  }
  /** Returns whether an in-progress EntityAIBase should continue executing */
  public boolean continueExecuting() {
    EntityLiving var1 = this.taskOwner.getAttackTarget();

    if (var1 == null) {
      return false;
    } else if (!var1.isEntityAlive()) {
      return false;
    } else if (this.taskOwner.getDistanceSqToEntity(var1)
        > (double) (this.targetDistance * this.targetDistance)) {
      return false;
    } else {
      if (this.field_48380_e) {
        if (!this.taskOwner.getEntitySenses().canSee(var1)) {
          if (++this.field_48378_g > 60) {
            return false;
          }
        } else {
          this.field_48378_g = 0;
        }
      }

      return true;
    }
  }