Beispiel #1
0
        /// <summary>
        /// Returns whether the EntityAIBase should begin execution.
        /// </summary>
        public override bool ShouldExecute()
        {
            if (!TheEntity.IsTamed())
            {
                return(false);
            }

            if (TheEntity.IsInWater())
            {
                return(false);
            }

            if (!TheEntity.OnGround)
            {
                return(false);
            }

            EntityLiving entityliving = TheEntity.GetOwner();

            if (entityliving == null)
            {
                return(true);
            }

            if (TheEntity.GetDistanceSqToEntity(entityliving) < 144D && entityliving.GetAITarget() != null)
            {
                return(false);
            }
            else
            {
                return(Field_48408_b);
            }
        }
        /// <summary>
        /// Returns whether the EntityAIBase should begin execution.
        /// </summary>
        public override bool ShouldExecute()
        {
            EntityLiving entityliving = ThePet.GetOwner();

            if (entityliving == null)
            {
                return(false);
            }

            if (ThePet.IsSitting())
            {
                return(false);
            }

            if (ThePet.GetDistanceSqToEntity(entityliving) < (double)(MinDist * MinDist))
            {
                return(false);
            }
            else
            {
                TheOwner = entityliving;
                return(true);
            }
        }