/// <summary>
        /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
        /// </summary>
        public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
        {
            int i = 3;
            int j = 5;

            if (CoordBaseMode == 1 || CoordBaseMode == 2)
            {
                i = 8 - i;
                j = 8 - j;
            }

            GetNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 5, 1);

            if (Field_35042_b)
            {
                GetNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, i, 1);
            }

            if (Field_35043_c)
            {
                GetNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, j, 7);
            }

            if (Field_35040_d)
            {
                GetNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, i, 1);
            }

            if (Field_35041_e)
            {
                GetNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, j, 7);
            }
        }
Example #2
0
        public static StructureBoundingBox Func_35051_a(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 4, par5);
            StructureComponent   structurecomponent   = StructureComponent.FindIntersecting(par0List, structureboundingbox);

            if (structurecomponent == null)
            {
                return(null);
            }

            if (structurecomponent.GetBoundingBox().MinY == structureboundingbox.MinY)
            {
                for (int i = 3; i >= 1; i--)
                {
                    StructureBoundingBox structureboundingbox1 = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, i - 1, par5);

                    if (!structurecomponent.GetBoundingBox().IntersectsWith(structureboundingbox1))
                    {
                        return(StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, i, par5));
                    }
                }
            }

            return(null);
        }
 /// <summary>
 /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
 /// </summary>
 public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
 {
     StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MinX - 1, BoundingBox.MaxY - 4, BoundingBox.MinZ + 1, 1, GetComponentType());
     StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MaxX + 1, BoundingBox.MaxY - 4, BoundingBox.MinZ + 1, 3, GetComponentType());
     StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MaxY - 4, BoundingBox.MinZ - 1, 2, GetComponentType());
     StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MaxY - 4, BoundingBox.MaxZ + 1, 0, GetComponentType());
 }
 /// <summary>
 /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
 /// </summary>
 public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
 {
     if (par1StructureComponent != null)
     {
         ((ComponentStrongholdStairs2)par1StructureComponent).PortalRoom = this;
     }
 }
Example #5
0
        /// <summary>
        /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
        /// </summary>
        public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
        {
            if (Field_35036_a)
            {
                StructureStrongholdPieces.SetComponentType(typeof(net.minecraft.src.ComponentStrongholdCrossing));
            }

            GetNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1);
        }
Example #6
0
        /// <summary>
        /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
        /// </summary>
        public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
        {
            int i = GetComponentType();

            switch (CorridorDirection)
            {
            case 2:
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MinZ - 1, 2, i);
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX - 1, BoundingBox.MinY, BoundingBox.MinZ + 1, 1, i);
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MaxX + 1, BoundingBox.MinY, BoundingBox.MinZ + 1, 3, i);
                break;

            case 0:
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MaxZ + 1, 0, i);
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX - 1, BoundingBox.MinY, BoundingBox.MinZ + 1, 1, i);
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MaxX + 1, BoundingBox.MinY, BoundingBox.MinZ + 1, 3, i);
                break;

            case 1:
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MinZ - 1, 2, i);
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MaxZ + 1, 0, i);
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX - 1, BoundingBox.MinY, BoundingBox.MinZ + 1, 1, i);
                break;

            case 3:
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MinZ - 1, 2, i);
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MaxZ + 1, 0, i);
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MaxX + 1, BoundingBox.MinY, BoundingBox.MinZ + 1, 3, i);
                break;
            }

            if (IsMultipleFloors)
            {
                if (par3Random.NextBool())
                {
                    StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MinY + 3 + 1, BoundingBox.MinZ - 1, 2, i);
                }

                if (par3Random.NextBool())
                {
                    StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX - 1, BoundingBox.MinY + 3 + 1, BoundingBox.MinZ + 1, 1, i);
                }

                if (par3Random.NextBool())
                {
                    StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MaxX + 1, BoundingBox.MinY + 3 + 1, BoundingBox.MinZ + 1, 3, i);
                }

                if (par3Random.NextBool())
                {
                    StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + 1, BoundingBox.MinY + 3 + 1, BoundingBox.MaxZ + 1, 0, i);
                }
            }
        }
        public static StructureBoundingBox FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = new StructureBoundingBox(par2, par3, par4, par2, par3 + 2, par4);
            int i = par1Random.Next(3) + 2;

            do
            {
                if (i <= 0)
                {
                    break;
                }

                int j = i * 5;

                switch (par5)
                {
                case 2:
                    structureboundingbox.MaxX = par2 + 2;
                    structureboundingbox.MinZ = par4 - (j - 1);
                    break;

                case 0:
                    structureboundingbox.MaxX = par2 + 2;
                    structureboundingbox.MaxZ = par4 + (j - 1);
                    break;

                case 1:
                    structureboundingbox.MinX = par2 - (j - 1);
                    structureboundingbox.MaxZ = par4 + 2;
                    break;

                case 3:
                    structureboundingbox.MaxX = par2 + (j - 1);
                    structureboundingbox.MaxZ = par4 + 2;
                    break;
                }

                if (StructureComponent.FindIntersecting(par0List, structureboundingbox) == null)
                {
                    break;
                }

                i--;
            }while (true);

            if (i > 0)
            {
                return(structureboundingbox);
            }
            else
            {
                return(null);
            }
        }
Example #8
0
 /// <summary>
 /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
 /// </summary>
 public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
 {
     if (CoordBaseMode == 2 || CoordBaseMode == 3)
     {
         GetNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1);
     }
     else
     {
         GetNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1);
     }
 }
        /// <summary>
        /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
        /// </summary>
        public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
        {
            sbyte byte0 = 1;

            if (CoordBaseMode == 1 || CoordBaseMode == 2)
            {
                byte0 = 5;
            }

            GetNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, byte0, par3Random.Next(8) > 0);
            GetNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, byte0, par3Random.Next(8) > 0);
        }
        /// <summary>
        /// Trys to find a valid place to put this component.
        /// </summary>
        public static ComponentVillageChurch FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, 0, 0, 0, 5, 12, 9, par5);

            if (!CanVillageGoDeeper(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentVillageChurch(par6, par1Random, structureboundingbox, par5));
            }
        }
        /// <summary>
        /// Trys to find a valid place to put this component.
        /// </summary>
        public static StructureBoundingBox FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, 0, 0, 0, 3, 4, 2, par5);

            if (StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(structureboundingbox);
            }
        }
        public static ComponentStrongholdStairsStraight FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -7, 0, 5, 11, 8, par5);

            if (!CanStrongholdGoDeeper(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentStrongholdStairsStraight(par6, par1Random, structureboundingbox, par5));
            }
        }
        public static ComponentNetherBridgeEnd Func_40023_a(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, -3, 0, 5, 10, 8, par5);

            if (!IsAboveGround(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentNetherBridgeEnd(par6, par1Random, structureboundingbox, par5));
            }
        }
Example #14
0
        public static ComponentVillageHouse4_Garden FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, 0, 0, 0, 5, 6, 5, par5);

            if (StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentVillageHouse4_Garden(par6, par1Random, structureboundingbox, par5));
            }
        }
Example #15
0
        /// <summary>
        /// Creates and returns a new component piece. Or null if it could not find enough room to place it.
        /// </summary>
        public static ComponentNetherBridgeCrossing2 CreateValidComponent(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5);

            if (!IsAboveGround(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(new ComponentNetherBridgeCrossing2(par6, par1Random, structureboundingbox, par5));
            }
        }
        /// <summary>
        /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
        /// </summary>
        public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
        {
            GetNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1);

            if (ExpandsX)
            {
                GetNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 2);
            }

            if (ExpandsZ)
            {
                GetNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 2);
            }
        }
        /// <summary>
        /// Discover if bounding box can fit within the current bounding box object.
        /// </summary>
        public static StructureComponent FindIntersecting(List <StructureComponent> par0List, StructureBoundingBox par1StructureBoundingBox)
        {
            for (IEnumerator <StructureComponent> iterator = par0List.GetEnumerator(); iterator.MoveNext();)
            {
                StructureComponent structurecomponent = iterator.Current;

                if (structurecomponent.GetBoundingBox() != null && structurecomponent.GetBoundingBox().IntersectsWith(par1StructureBoundingBox))
                {
                    return(structurecomponent);
                }
            }

            return(null);
        }
        public StructureVillageStart(World par1World, Random par2Random, int par3, int par4, int par5)
        {
            HasMoreThanTwoComponents = false;
            int i = par5;
            List <StructureVillagePieceWeight> arraylist = StructureVillagePieces.GetStructureVillageWeightedPieceList(par2Random, i);
            ComponentVillageStartPiece         componentvillagestartpiece = new ComponentVillageStartPiece(par1World.GetWorldChunkManager(), 0, par2Random, (par3 << 4) + 2, (par4 << 4) + 2, arraylist, i);

            Components.Add(componentvillagestartpiece);
            componentvillagestartpiece.BuildComponent(componentvillagestartpiece, Components, par2Random);
            List <StructureComponent> arraylist1 = componentvillagestartpiece.Field_35106_f;

            for (List <StructureComponent> arraylist2 = componentvillagestartpiece.Field_35108_e; arraylist1.Count > 0 || arraylist2.Count > 0;)
            {
                if (arraylist1.Count > 0)
                {
                    int j = par2Random.Next(arraylist1.Count);
                    StructureComponent structurecomponent = arraylist1[i];
                    arraylist1.RemoveAt(j);
                    structurecomponent.BuildComponent(componentvillagestartpiece, Components, par2Random);
                }
                else
                {
                    int k = par2Random.Next(arraylist2.Count);
                    StructureComponent structurecomponent1 = arraylist2[k];
                    arraylist2.RemoveAt(k);
                    structurecomponent1.BuildComponent(componentvillagestartpiece, Components, par2Random);
                }
            }

            UpdateBoundingBox();
            int l = 0;
            IEnumerator <StructureComponent> iterator = Components.GetEnumerator();

            do
            {
                if (!iterator.MoveNext())
                {
                    break;
                }

                StructureComponent structurecomponent2 = iterator.Current;

                if (!(structurecomponent2 is ComponentVillageRoadPiece))
                {
                    l++;
                }
            }while (true);

            HasMoreThanTwoComponents = l > 2;
        }
        public static StructureBoundingBox Func_35087_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List <StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6)
        {
            for (int i = 7 * MathHelper2.GetRandomIntegerInRange(par2Random, 3, 5); i >= 7; i -= 7)
            {
                StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 3, 3, i, par6);

                if (StructureComponent.FindIntersecting(par1List, structureboundingbox) == null)
                {
                    return(structureboundingbox);
                }
            }

            return(null);
        }
        /// <summary>
        /// 'Keeps iterating Structure Pieces and spawning them until the checks tell it to stop'
        /// </summary>
        public virtual void GenerateStructure(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            List <StructureComponent> iterator = Components;

            while (iterator.Count > 0)
            {
                StructureComponent structurecomponent = iterator[0];

                if (structurecomponent.GetBoundingBox().IntersectsWith(par3StructureBoundingBox) && !structurecomponent.AddComponentParts(par1World, par2Random, par3StructureBoundingBox))
                {
                    iterator.RemoveAt(0);
                }
            }
        }
Example #21
0
        public static ComponentStrongholdLibrary FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
        {
            StructureBoundingBox structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 14, 11, 15, par5);

            if (!CanStrongholdGoDeeper(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                structureboundingbox = StructureBoundingBox.GetComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 14, 6, 15, par5);

                if (!CanStrongholdGoDeeper(structureboundingbox) || StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
                {
                    return(null);
                }
            }

            return(new ComponentStrongholdLibrary(par6, par1Random, structureboundingbox, par5));
        }
Example #22
0
        public static StructureBoundingBox FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = new StructureBoundingBox(par2, par3, par4, par2, par3 + 2, par4);

            if (par1Random.Next(4) == 0)
            {
                structureboundingbox.MaxY += 4;
            }

            switch (par5)
            {
            case 2:
                structureboundingbox.MinX = par2 - 1;
                structureboundingbox.MaxX = par2 + 3;
                structureboundingbox.MinZ = par4 - 4;
                break;

            case 0:
                structureboundingbox.MinX = par2 - 1;
                structureboundingbox.MaxX = par2 + 3;
                structureboundingbox.MaxZ = par4 + 4;
                break;

            case 1:
                structureboundingbox.MinX = par2 - 4;
                structureboundingbox.MinZ = par4 - 1;
                structureboundingbox.MaxZ = par4 + 3;
                break;

            case 3:
                structureboundingbox.MaxX = par2 + 4;
                structureboundingbox.MinZ = par4 - 1;
                structureboundingbox.MaxZ = par4 + 3;
                break;
            }

            if (StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(structureboundingbox);
            }
        }
        private static StructureComponent GetNextMineShaftComponent(StructureComponent par0StructureComponent, List <StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7)
        {
            if (par7 > 8)
            {
                return(null);
            }

            if (Math.Abs(par3 - par0StructureComponent.GetBoundingBox().MinX) > 80 || Math.Abs(par5 - par0StructureComponent.GetBoundingBox().MinZ) > 80)
            {
                return(null);
            }

            StructureComponent structurecomponent = GetRandomComponent(par1List, par2Random, par3, par4, par5, par6, par7 + 1);

            if (structurecomponent != null)
            {
                par1List.Add(structurecomponent);
                structurecomponent.BuildComponent(par0StructureComponent, par1List, par2Random);
            }

            return(structurecomponent);
        }
        /// <summary>
        /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
        /// </summary>
        public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
        {
            int i = GetComponentType();

            switch (CoordBaseMode)
            {
            case 2:
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX, BoundingBox.MinY, BoundingBox.MinZ - 1, 2, i);
                break;

            case 0:
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX, BoundingBox.MinY, BoundingBox.MaxZ + 1, 0, i);
                break;

            case 1:
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX - 1, BoundingBox.MinY, BoundingBox.MinZ, 1, i);
                break;

            case 3:
                StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MaxX + 1, BoundingBox.MinY, BoundingBox.MinZ, 3, i);
                break;
            }
        }
        /// <summary>
        /// Trys to find a valid place to put this component.
        /// </summary>
        public static StructureBoundingBox FindValidPlacement(List <StructureComponent> par0List, Random par1Random, int par2, int par3, int par4, int par5)
        {
            StructureBoundingBox structureboundingbox = new StructureBoundingBox(par2, par3 - 5, par4, par2, par3 + 2, par4);

            switch (par5)
            {
            case 2:
                structureboundingbox.MaxX = par2 + 2;
                structureboundingbox.MinZ = par4 - 8;
                break;

            case 0:
                structureboundingbox.MaxX = par2 + 2;
                structureboundingbox.MaxZ = par4 + 8;
                break;

            case 1:
                structureboundingbox.MinX = par2 - 8;
                structureboundingbox.MaxZ = par4 + 2;
                break;

            case 3:
                structureboundingbox.MaxX = par2 + 8;
                structureboundingbox.MaxZ = par4 + 2;
                break;
            }

            if (StructureComponent.FindIntersecting(par0List, structureboundingbox) != null)
            {
                return(null);
            }
            else
            {
                return(structureboundingbox);
            }
        }
        /// <summary>
        /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
        /// </summary>
        public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
        {
            int i  = GetComponentType();
            int j1 = BoundingBox.GetYSize() - 3 - 1;

            if (j1 <= 0)
            {
                j1 = 1;
            }

            for (int j = 0; j < BoundingBox.GetXSize(); j += 4)
            {
                j += par3Random.Next(BoundingBox.GetXSize());

                if (j + 3 > BoundingBox.GetXSize())
                {
                    break;
                }

                StructureComponent structurecomponent = StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + j, BoundingBox.MinY + par3Random.Next(j1) + 1, BoundingBox.MinZ - 1, 2, i);

                if (structurecomponent != null)
                {
                    StructureBoundingBox structureboundingbox = structurecomponent.GetBoundingBox();
                    ChidStructures.AddLast(new StructureBoundingBox(structureboundingbox.MinX, structureboundingbox.MinY, BoundingBox.MinZ, structureboundingbox.MaxX, structureboundingbox.MaxY, BoundingBox.MinZ + 1));
                }
            }

            for (int k = 0; k < BoundingBox.GetXSize(); k += 4)
            {
                k += par3Random.Next(BoundingBox.GetXSize());

                if (k + 3 > BoundingBox.GetXSize())
                {
                    break;
                }

                StructureComponent structurecomponent1 = StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX + k, BoundingBox.MinY + par3Random.Next(j1) + 1, BoundingBox.MaxZ + 1, 0, i);

                if (structurecomponent1 != null)
                {
                    StructureBoundingBox structureboundingbox1 = structurecomponent1.GetBoundingBox();
                    ChidStructures.AddLast(new StructureBoundingBox(structureboundingbox1.MinX, structureboundingbox1.MinY, BoundingBox.MaxZ - 1, structureboundingbox1.MaxX, structureboundingbox1.MaxY, BoundingBox.MaxZ));
                }
            }

            for (int l = 0; l < BoundingBox.GetZSize(); l += 4)
            {
                l += par3Random.Next(BoundingBox.GetZSize());

                if (l + 3 > BoundingBox.GetZSize())
                {
                    break;
                }

                StructureComponent structurecomponent2 = StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MinX - 1, BoundingBox.MinY + par3Random.Next(j1) + 1, BoundingBox.MinZ + l, 1, i);

                if (structurecomponent2 != null)
                {
                    StructureBoundingBox structureboundingbox2 = structurecomponent2.GetBoundingBox();
                    ChidStructures.AddLast(new StructureBoundingBox(BoundingBox.MinX, structureboundingbox2.MinY, structureboundingbox2.MinZ, BoundingBox.MinX + 1, structureboundingbox2.MaxY, structureboundingbox2.MaxZ));
                }
            }

            for (int i1 = 0; i1 < BoundingBox.GetZSize(); i1 += 4)
            {
                i1 += par3Random.Next(BoundingBox.GetZSize());

                if (i1 + 3 > BoundingBox.GetZSize())
                {
                    break;
                }

                StructureComponent structurecomponent3 = StructureMineshaftPieces.GetNextComponent(par1StructureComponent, par2List, par3Random, BoundingBox.MaxX + 1, BoundingBox.MinY + par3Random.Next(j1) + 1, BoundingBox.MinZ + i1, 3, i);

                if (structurecomponent3 != null)
                {
                    StructureBoundingBox structureboundingbox3 = structurecomponent3.GetBoundingBox();
                    ChidStructures.AddLast(new StructureBoundingBox(BoundingBox.MaxX - 1, structureboundingbox3.MinY, structureboundingbox3.MinZ, BoundingBox.MaxX, structureboundingbox3.MaxY, structureboundingbox3.MaxZ));
                }
            }
        }
        /// <summary>
        /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
        /// </summary>
        public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
        {
            bool flag = false;

            for (int i = par3Random.Next(5); i < AverageGroundLevel - 8; i += 2 + par3Random.Next(5))
            {
                StructureComponent structurecomponent = GetNextComponentNN((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, 0, i);

                if (structurecomponent != null)
                {
                    i   += Math.Max(structurecomponent.BoundingBox.GetXSize(), structurecomponent.BoundingBox.GetZSize());
                    flag = true;
                }
            }

            for (int j = par3Random.Next(5); j < AverageGroundLevel - 8; j += 2 + par3Random.Next(5))
            {
                StructureComponent structurecomponent1 = GetNextComponentPP((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, 0, j);

                if (structurecomponent1 != null)
                {
                    j   += Math.Max(structurecomponent1.BoundingBox.GetXSize(), structurecomponent1.BoundingBox.GetZSize());
                    flag = true;
                }
            }

            if (flag && par3Random.Next(3) > 0)
            {
                switch (CoordBaseMode)
                {
                case 2:
                    StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MinX - 1, BoundingBox.MinY, BoundingBox.MinZ, 1, GetComponentType());
                    break;

                case 0:
                    StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MinX - 1, BoundingBox.MinY, BoundingBox.MaxZ - 2, 1, GetComponentType());
                    break;

                case 3:
                    StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MaxX - 2, BoundingBox.MinY, BoundingBox.MinZ - 1, 2, GetComponentType());
                    break;

                case 1:
                    StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MinX, BoundingBox.MinY, BoundingBox.MinZ - 1, 2, GetComponentType());
                    break;
                }
            }

            if (flag && par3Random.Next(3) > 0)
            {
                switch (CoordBaseMode)
                {
                case 2:
                    StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MaxX + 1, BoundingBox.MinY, BoundingBox.MinZ, 3, GetComponentType());
                    break;

                case 0:
                    StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MaxX + 1, BoundingBox.MinY, BoundingBox.MaxZ - 2, 3, GetComponentType());
                    break;

                case 3:
                    StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MaxX - 2, BoundingBox.MinY, BoundingBox.MaxZ + 1, 0, GetComponentType());
                    break;

                case 1:
                    StructureVillagePieces.GetNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, BoundingBox.MinX, BoundingBox.MinY, BoundingBox.MaxZ + 1, 0, GetComponentType());
                    break;
                }
            }
        }
Example #28
0
 /// <summary>
 /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
 /// </summary>
 public override void BuildComponent(StructureComponent par1StructureComponent, List <StructureComponent> par2List, Random par3Random)
 {
     GetNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 0, true);
     GetNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true);
     GetNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true);
 }
 public static StructureComponent GetNextComponent(StructureComponent par0StructureComponent, List <StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7)
 {
     return(GetNextMineShaftComponent(par0StructureComponent, par1List, par2Random, par3, par4, par5, par6, par7));
 }
Example #30
0
 /// <summary>
 /// 'Initiates construction of the Structure Component picked, at the current Location of StructGen'
 /// </summary>
 public override void BuildComponent(StructureComponent structurecomponent, List <StructureComponent> list, Random random)
 {
 }