Exemple #1
0
  @Override
  public boolean shouldStart() {
    if (myPet.getRangedDamage() <= 0) {
      return false;
    }
    if (!entityMyPet.canMove()) {
      return false;
    }
    if (!entityMyPet.hasTarget()) {
      return false;
    }

    EntityLiving target = ((CraftLivingEntity) this.entityMyPet.getTarget()).getHandle();

    if (target instanceof EntityArmorStand) {
      return false;
    }
    double meleeDamage = myPet.getDamage();
    if (meleeDamage > 0
        && this.entityMyPet.f(target.locX, target.getBoundingBox().b, target.locZ) < 4) {
      if (meleeDamage > rangedSkill.getDamage()) {
        return false;
      }
    }
    this.target = target;
    return true;
  }
Exemple #2
0
 @Override
 public boolean shouldFinish() {
   if (entityMyPet.getTarget() == null
       || !target.isAlive()
       || myPet.getRangedDamage() <= 0
       || !entityMyPet.canMove()) {
     return true;
   }
   if (this.target.getBukkitEntity() != this.myPet.getEntity().getTarget()) {
     return true;
   }
   double meleeDamage = myPet.getDamage();
   if (meleeDamage > 0
       && this.entityMyPet.f(target.locX, target.getBoundingBox().b, target.locZ) < 4) {
     if (meleeDamage > rangedSkill.getDamage()) {
       return true;
     }
   }
   return false;
 }