Beispiel #1
0
 public static Vec3D Func_48623_b(EntityCreature par0EntityCreature, int par1, int par2, Vec3D par3Vec3D)
 {
     Field_48624_a.XCoord = par0EntityCreature.PosX - par3Vec3D.XCoord;
     Field_48624_a.YCoord = par0EntityCreature.PosY - par3Vec3D.YCoord;
     Field_48624_a.ZCoord = par0EntityCreature.PosZ - par3Vec3D.ZCoord;
     return(Func_48621_c(par0EntityCreature, par1, par2, Field_48624_a));
 }
Beispiel #2
0
 public EntityAIFleeSun(EntityCreature par1EntityCreature, float par2)
 {
     TheCreature   = par1EntityCreature;
     Field_48299_e = par2;
     TheWorld      = par1EntityCreature.WorldObj;
     SetMutexBits(1);
 }
 public EntityAIMoveThroughVillage(EntityCreature par1EntityCreature, float par2, bool par3)
 {
     DoorList      = new List <VillageDoorInfo>();
     TheEntity     = par1EntityCreature;
     Field_48290_b = par2;
     Field_48289_e = par3;
     SetMutexBits(1);
 }
 public EntityAITempt(EntityCreature par1EntityCreature, float par2, int par3, bool par4)
 {
     DelayTemptCounter      = 0;
     TemptedEntity          = par1EntityCreature;
     Field_48275_b          = par2;
     BreedingFood           = par3;
     ScaredByPlayerMovement = par4;
     SetMutexBits(3);
 }
Beispiel #5
0
 public EntityAIAvoidEntity(EntityCreature par1EntityCreature, Type par2Class, float par3, float par4, float par5)
 {
     TheEntity          = par1EntityCreature;
     TargetEntityClass  = par2Class;
     Field_48241_e      = par3;
     Field_48242_b      = par4;
     Field_48243_c      = par5;
     EntityPathNavigate = par1EntityCreature.GetNavigator();
     SetMutexBits(1);
 }
Beispiel #6
0
        private static Vec3D Func_48621_c(EntityCreature par0EntityCreature, int par1, int par2, Vec3D par3Vec3D)
        {
            Random random = par0EntityCreature.GetRNG();
            bool   flag   = false;
            int    i      = 0;
            int    j      = 0;
            int    k      = 0;
            float  f      = -99999F;
            bool   flag1;

            if (par0EntityCreature.HasHome())
            {
                double d = par0EntityCreature.GetHomePosition().GetEuclideanDistanceTo(MathHelper2.Floor_double(par0EntityCreature.PosX), MathHelper2.Floor_double(par0EntityCreature.PosY), MathHelper2.Floor_double(par0EntityCreature.PosZ)) + 4D;
                flag1 = d < (double)(par0EntityCreature.GetMaximumHomeDistance() + (float)par1);
            }
            else
            {
                flag1 = false;
            }

            for (int l = 0; l < 10; l++)
            {
                int i1 = random.Next(2 * par1) - par1;
                int j1 = random.Next(2 * par2) - par2;
                int k1 = random.Next(2 * par1) - par1;

                if (par3Vec3D != null && (double)i1 * par3Vec3D.XCoord + (double)k1 * par3Vec3D.ZCoord < 0.0F)
                {
                    continue;
                }

                i1 += MathHelper2.Floor_double(par0EntityCreature.PosX);
                j1 += MathHelper2.Floor_double(par0EntityCreature.PosY);
                k1 += MathHelper2.Floor_double(par0EntityCreature.PosZ);

                if (flag1 && !par0EntityCreature.IsWithinHomeDistance(i1, j1, k1))
                {
                    continue;
                }

                float f1 = par0EntityCreature.GetBlockPathWeight(i1, j1, k1);

                if (f1 > f)
                {
                    f    = f1;
                    i    = i1;
                    j    = j1;
                    k    = k1;
                    flag = true;
                }
            }

            if (flag)
            {
                return(Vec3D.CreateVector(i, j, k));
            }
            else
            {
                return(null);
            }
        }
Beispiel #7
0
 public static Vec3D Func_48622_a(EntityCreature par0EntityCreature, int par1, int par2)
 {
     return(Func_48621_c(par0EntityCreature, par1, par2, null));
 }