/// <summary>
        /// Returns whether an in-progress EntityAIBase should continue executing
        /// </summary>
        public override bool ContinueExecuting()
        {
            if (ScaredByPlayerMovement)
            {
                if (TemptedEntity.GetDistanceSqToEntity(TemptingPlayer) < 36D)
                {
                    if (TemptingPlayer.GetDistanceSq(Field_48276_c, Field_48273_d, Field_48274_e) > 0.010000000000000002F)
                    {
                        return(false);
                    }

                    if (Math.Abs((double)TemptingPlayer.RotationPitch - Field_48271_f) > 5D || Math.Abs((double)TemptingPlayer.RotationYaw - Field_48272_g) > 5D)
                    {
                        return(false);
                    }
                }
                else
                {
                    Field_48276_c = TemptingPlayer.PosX;
                    Field_48273_d = TemptingPlayer.PosY;
                    Field_48274_e = TemptingPlayer.PosZ;
                }

                Field_48271_f = TemptingPlayer.RotationPitch;
                Field_48272_g = TemptingPlayer.RotationYaw;
            }

            return(ShouldExecute());
        }
예제 #2
0
 /// <summary>
 /// Updates the task
 /// </summary>
 public override void UpdateTask()
 {
     if (TheEntity.GetDistanceSqToEntity(Field_48240_d) < 49D)
     {
         TheEntity.GetNavigator().SetSpeed(Field_48243_c);
     }
     else
     {
         TheEntity.GetNavigator().SetSpeed(Field_48242_b);
     }
 }