Пример #1
0
 @Override
 protected boolean isValidTarget(Entity ent) {
   if (ent instanceof TargetEntity) return ((TargetEntity) ent).shouldTarget(this, placerUUID);
   if (!(ent instanceof EntityLivingBase)) return false;
   EntityLivingBase elb = (EntityLivingBase) ent;
   if (elb.isDead || elb.getHealth() <= 0) return false;
   if (ent.onGround || ent.isInWater() || ent.isInsideOfMaterial(Material.lava)) return false;
   if (elb instanceof EntityFlying && ReikaEntityHelper.isHostile(elb)) {
     return ReikaMathLibrary.py3d(
             ent.posX - xCoord - 0.5, ent.posY - yCoord - 0.5, ent.posZ - zCoord - 0.5)
         > 2;
   }
   if (ent instanceof EntityBlaze || ent instanceof EntityWither || ent instanceof EntityDragon) {
     return ReikaMathLibrary.py3d(
             ent.posX - xCoord - 0.5, ent.posY - yCoord - 0.5, ent.posZ - zCoord - 0.5)
         > 2;
   }
   if (ent instanceof FlyingMob) {
     FlyingMob fm = (FlyingMob) ent;
     return fm.isCurrentlyFlying()
         && fm.isHostile()
         && ReikaMathLibrary.py3d(
                 ent.posX - xCoord - 0.5, ent.posY - yCoord - 0.5, ent.posZ - zCoord - 0.5)
             > 2;
   }
   if (InterfaceCache.BCROBOT.instanceOf(ent)) {
     return true;
   }
   return false;
 }
 protected final boolean isMobOrUnlistedPlayer(EntityLivingBase ent) {
   return (ReikaEntityHelper.isHostile(ent)
       || (targetPlayers
           && ent instanceof EntityPlayer
           && !this.playerIsSafe(((EntityPlayer) ent))));
 }