Ejemplo n.º 1
0
        /// <summary>
        /// Checks if the entity's current position is a valid location to spawn this entity.
        /// </summary>
        public override bool GetCanSpawnHere()
        {
            if (WorldObj.Rand.Next(3) == 0)
            {
                return(false);
            }

            if (WorldObj.CheckIfAABBIsClear(BoundingBox) && WorldObj.GetCollidingBoundingBoxes(this, BoundingBox).Count == 0 && !WorldObj.IsAnyLiquid(BoundingBox))
            {
                int i = MathHelper2.Floor_double(PosX);
                int j = MathHelper2.Floor_double(BoundingBox.MinY);
                int k = MathHelper2.Floor_double(PosZ);

                if (j < 63)
                {
                    return(false);
                }

                int l = WorldObj.GetBlockId(i, j - 1, k);

                if (l == Block.Grass.BlockID || l == Block.Leaves.BlockID)
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Checks if the entity's current position is a valid location to spawn this entity.
 /// </summary>
 public override bool GetCanSpawnHere()
 {
     return(WorldObj.CheckIfAABBIsClear(BoundingBox));
 }
 /// <summary>
 /// Checks if the entity's current position is a valid location to spawn this entity.
 /// </summary>
 public override bool GetCanSpawnHere()
 {
     return(WorldObj.DifficultySetting > 0 && WorldObj.CheckIfAABBIsClear(BoundingBox) && WorldObj.GetCollidingBoundingBoxes(this, BoundingBox).Count == 0 && !WorldObj.IsAnyLiquid(BoundingBox));
 }