Java 类net.minecraft.entity.EntityOwnable 实例源码

项目:RuneCraftery    文件:EntityAITarget.java   
protected boolean func_75296_a(EntityLivingBase p_75296_1_, boolean p_75296_2_) {
   if(p_75296_1_ == null) {
      return false;
   } else if(p_75296_1_ == this.field_75299_d) {
      return false;
   } else if(!p_75296_1_.func_70089_S()) {
      return false;
   } else if(!this.field_75299_d.func_70686_a(p_75296_1_.getClass())) {
      return false;
   } else {
      if(this.field_75299_d instanceof EntityOwnable && StringUtils.isNotEmpty(((EntityOwnable)this.field_75299_d).func_70905_p())) {
         if(p_75296_1_ instanceof EntityOwnable && ((EntityOwnable)this.field_75299_d).func_70905_p().equals(((EntityOwnable)p_75296_1_).func_70905_p())) {
            return false;
         }

         if(p_75296_1_ == ((EntityOwnable)this.field_75299_d).func_70902_q()) {
            return false;
         }
      } else if(p_75296_1_ instanceof EntityPlayer && !p_75296_2_ && ((EntityPlayer)p_75296_1_).field_71075_bZ.field_75102_a) {
         return false;
      }

      if(!this.field_75299_d.func_110176_b(MathHelper.func_76128_c(p_75296_1_.field_70165_t), MathHelper.func_76128_c(p_75296_1_.field_70163_u), MathHelper.func_76128_c(p_75296_1_.field_70161_v))) {
         return false;
      } else if(this.field_75297_f && !this.field_75299_d.func_70635_at().func_75522_a(p_75296_1_)) {
         return false;
      } else {
         if(this.field_75303_a) {
            if(--this.field_75302_c <= 0) {
               this.field_75301_b = 0;
            }

            if(this.field_75301_b == 0) {
               this.field_75301_b = this.func_75295_a(p_75296_1_)?1:2;
            }

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

         return true;
      }
   }
}
项目:RuneCraftery    文件:EntityAITarget.java   
/**
 * A method used to see if an entity is a suitable target through a number of checks.
 */
protected boolean isSuitableTarget(EntityLivingBase par1EntityLivingBase, boolean par2)
{
    if (par1EntityLivingBase == null)
    {
        return false;
    }
    else if (par1EntityLivingBase == this.taskOwner)
    {
        return false;
    }
    else if (!par1EntityLivingBase.isEntityAlive())
    {
        return false;
    }
    else if (!this.taskOwner.canAttackClass(par1EntityLivingBase.getClass()))
    {
        return false;
    }
    else
    {
        if (this.taskOwner instanceof EntityOwnable && StringUtils.isNotEmpty(((EntityOwnable)this.taskOwner).getOwnerName()))
        {
            if (par1EntityLivingBase instanceof EntityOwnable && ((EntityOwnable)this.taskOwner).getOwnerName().equals(((EntityOwnable)par1EntityLivingBase).getOwnerName()))
            {
                return false;
            }

            if (par1EntityLivingBase == ((EntityOwnable)this.taskOwner).getOwner())
            {
                return false;
            }
        }
        else if (par1EntityLivingBase instanceof EntityPlayer && !par2 && ((EntityPlayer)par1EntityLivingBase).capabilities.disableDamage)
        {
            return false;
        }

        if (!this.taskOwner.func_110176_b(MathHelper.floor_double(par1EntityLivingBase.posX), MathHelper.floor_double(par1EntityLivingBase.posY), MathHelper.floor_double(par1EntityLivingBase.posZ)))
        {
            return false;
        }
        else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLivingBase))
        {
            return false;
        }
        else
        {
            if (this.nearbyOnly)
            {
                if (--this.targetSearchDelay <= 0)
                {
                    this.targetSearchStatus = 0;
                }

                if (this.targetSearchStatus == 0)
                {
                    this.targetSearchStatus = this.canEasilyReach(par1EntityLivingBase) ? 1 : 2;
                }

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

            return true;
        }
    }
}
项目:BetterNutritionMod    文件:EntityAITarget.java   
/**
 * A method used to see if an entity is a suitable target through a number of checks.
 */
protected boolean isSuitableTarget(EntityLivingBase par1EntityLivingBase, boolean par2)
{
    if (par1EntityLivingBase == null)
    {
        return false;
    }
    else if (par1EntityLivingBase == this.taskOwner)
    {
        return false;
    }
    else if (!par1EntityLivingBase.isEntityAlive())
    {
        return false;
    }
    else if (!this.taskOwner.canAttackClass(par1EntityLivingBase.getClass()))
    {
        return false;
    }
    else
    {
        if (this.taskOwner instanceof EntityOwnable && StringUtils.isNotEmpty(((EntityOwnable)this.taskOwner).getOwnerName()))
        {
            if (par1EntityLivingBase instanceof EntityOwnable && ((EntityOwnable)this.taskOwner).getOwnerName().equals(((EntityOwnable)par1EntityLivingBase).getOwnerName()))
            {
                return false;
            }

            if (par1EntityLivingBase == ((EntityOwnable)this.taskOwner).getOwner())
            {
                return false;
            }
        }
        else if (par1EntityLivingBase instanceof EntityPlayer && !par2 && ((EntityPlayer)par1EntityLivingBase).capabilities.disableDamage)
        {
            return false;
        }

        if (!this.taskOwner.func_110176_b(MathHelper.floor_double(par1EntityLivingBase.posX), MathHelper.floor_double(par1EntityLivingBase.posY), MathHelper.floor_double(par1EntityLivingBase.posZ)))
        {
            return false;
        }
        else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLivingBase))
        {
            return false;
        }
        else
        {
            if (this.nearbyOnly)
            {
                if (--this.targetSearchDelay <= 0)
                {
                    this.targetSearchStatus = 0;
                }

                if (this.targetSearchStatus == 0)
                {
                    this.targetSearchStatus = this.canEasilyReach(par1EntityLivingBase) ? 1 : 2;
                }

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

            return true;
        }
    }
}