/// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            FillWithBlocks(par1World, par3StructureBoundingBox, 7, 3, 0, 11, 4, 18, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 7, 18, 4, 11, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 0, 10, 7, 18, 0, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 8, 18, 7, 10, 0, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 7, 5, 0, 7, 5, 7, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 7, 5, 11, 7, 5, 18, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 0, 11, 5, 7, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 11, 11, 5, 18, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 7, 7, 5, 7, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 7, 18, 5, 7, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 11, 7, 5, 11, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 11, 18, 5, 11, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 7, 2, 0, 11, 2, 5, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 7, 2, 13, 11, 2, 18, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 0, 11, 1, 3, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 15, 11, 1, 18, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);

            for (int i = 7; i <= 11; i++)
            {
                for (int k = 0; k <= 2; k++)
                {
                    FillCurrentPositionBlocksDownwards(par1World, Block.NetherBrick.BlockID, 0, i, -1, k, par3StructureBoundingBox);
                    FillCurrentPositionBlocksDownwards(par1World, Block.NetherBrick.BlockID, 0, i, -1, 18 - k, par3StructureBoundingBox);
                }
            }

            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 7, 5, 2, 11, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 13, 2, 7, 18, 2, 11, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 7, 3, 1, 11, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 15, 0, 7, 18, 1, 11, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);

            for (int j = 0; j <= 2; j++)
            {
                for (int l = 7; l <= 11; l++)
                {
                    FillCurrentPositionBlocksDownwards(par1World, Block.NetherBrick.BlockID, 0, j, -1, l, par3StructureBoundingBox);
                    FillCurrentPositionBlocksDownwards(par1World, Block.NetherBrick.BlockID, 0, 18 - j, -1, l, par3StructureBoundingBox);
                }
            }

            return(true);
        }
Example #2
0
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (AverageGroundLevel < 0)
            {
                AverageGroundLevel = GetAverageGroundLevel(par1World, par3StructureBoundingBox);

                if (AverageGroundLevel < 0)
                {
                    return(true);
                }

                BoundingBox.Offset(0, ((AverageGroundLevel - BoundingBox.MaxY) + 4) - 1, 0);
            }

            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 6, 4, 8, 0, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 7, Block.TilledField.BlockID, Block.TilledField.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 1, 5, 0, 7, Block.TilledField.BlockID, Block.TilledField.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 0, 8, Block.Wood.BlockID, Block.Wood.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 6, 0, 0, 6, 0, 8, Block.Wood.BlockID, Block.Wood.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 5, 0, 0, Block.Wood.BlockID, Block.Wood.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 8, 5, 0, 8, Block.Wood.BlockID, Block.Wood.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 3, 0, 1, 3, 0, 7, Block.WaterMoving.BlockID, Block.WaterMoving.BlockID, false);

            for (int i = 1; i <= 7; i++)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 1, 1, i, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 2, 1, i, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 4, 1, i, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Crops.BlockID, MathHelper2.GetRandomIntegerInRange(par2Random, 2, 7), 5, 1, i, par3StructureBoundingBox);
            }

            for (int j = 0; j < 9; j++)
            {
                for (int k = 0; k < 7; k++)
                {
                    ClearCurrentPositionBlocksUpwards(par1World, k, 4, j, par3StructureBoundingBox);
                    FillCurrentPositionBlocksDownwards(par1World, Block.Dirt.BlockID, 0, k, -1, j, par3StructureBoundingBox);
                }
            }

            return(true);
        }
Example #3
0
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 4, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 5, 4, 0, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 5, 0, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 4, 5, 0, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 0, 5, 4, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 4, 4, 5, 4, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 4, 6, 4, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);

            for (int i = 0; i <= 4; i++)
            {
                for (int j = 0; j <= 4; j++)
                {
                    FillCurrentPositionBlocksDownwards(par1World, Block.NetherBrick.BlockID, 0, i, -1, j, par3StructureBoundingBox);
                }
            }

            return(true);
        }
Example #4
0
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (IsLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox))
            {
                return(false);
            }

            if (IsMultipleFloors)
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MinZ, BoundingBox.MaxX - 1, (BoundingBox.MinY + 3) - 1, BoundingBox.MaxZ, 0, 0, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MinX, BoundingBox.MinY, BoundingBox.MinZ + 1, BoundingBox.MaxX, (BoundingBox.MinY + 3) - 1, BoundingBox.MaxZ - 1, 0, 0, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MinX + 1, BoundingBox.MaxY - 2, BoundingBox.MinZ, BoundingBox.MaxX - 1, BoundingBox.MaxY, BoundingBox.MaxZ, 0, 0, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MinX, BoundingBox.MaxY - 2, BoundingBox.MinZ + 1, BoundingBox.MaxX, BoundingBox.MaxY, BoundingBox.MaxZ - 1, 0, 0, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MinX + 1, BoundingBox.MinY + 3, BoundingBox.MinZ + 1, BoundingBox.MaxX - 1, BoundingBox.MinY + 3, BoundingBox.MaxZ - 1, 0, 0, false);
            }
            else
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MinZ, BoundingBox.MaxX - 1, BoundingBox.MaxY, BoundingBox.MaxZ, 0, 0, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MinX, BoundingBox.MinY, BoundingBox.MinZ + 1, BoundingBox.MaxX, BoundingBox.MaxY, BoundingBox.MaxZ - 1, 0, 0, false);
            }

            FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MinZ + 1, BoundingBox.MinX + 1, BoundingBox.MaxY, BoundingBox.MinZ + 1, Block.Planks.BlockID, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MinX + 1, BoundingBox.MinY, BoundingBox.MaxZ - 1, BoundingBox.MinX + 1, BoundingBox.MaxY, BoundingBox.MaxZ - 1, Block.Planks.BlockID, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MaxX - 1, BoundingBox.MinY, BoundingBox.MinZ + 1, BoundingBox.MaxX - 1, BoundingBox.MaxY, BoundingBox.MinZ + 1, Block.Planks.BlockID, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, BoundingBox.MaxX - 1, BoundingBox.MinY, BoundingBox.MaxZ - 1, BoundingBox.MaxX - 1, BoundingBox.MaxY, BoundingBox.MaxZ - 1, Block.Planks.BlockID, 0, false);

            for (int i = BoundingBox.MinX; i <= BoundingBox.MaxX; i++)
            {
                for (int j = BoundingBox.MinZ; j <= BoundingBox.MaxZ; j++)
                {
                    int k = GetBlockIdAtCurrentPosition(par1World, i, BoundingBox.MinY - 1, j, par3StructureBoundingBox);

                    if (k == 0)
                    {
                        PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, i, BoundingBox.MinY - 1, j, par3StructureBoundingBox);
                    }
                }
            }

            return(true);
        }
Example #5
0
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (IsLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox))
            {
                return(false);
            }

            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 4, true, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            PlaceDoor(par1World, par2Random, par3StructureBoundingBox, DoorType, 1, 1, 0);

            if (CoordBaseMode == 2 || CoordBaseMode == 3)
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 3, 0, 0, false);
            }
            else
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, 0, 0, false);
            }

            return(true);
        }
Example #6
0
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            int i = GetMetadataWithOffset(Block.StairsNetherBrick.BlockID, 2);

            for (int j = 0; j <= 9; j++)
            {
                int k  = Math.Max(1, 7 - j);
                int l  = Math.Min(Math.Max(k + 5, 14 - j), 13);
                int i1 = j;
                FillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, i1, 4, k, i1, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 1, k + 1, i1, 3, l - 1, i1, 0, 0, false);

                if (j <= 6)
                {
                    PlaceBlockAtCurrentPosition(par1World, Block.StairsNetherBrick.BlockID, i, 1, k + 1, i1, par3StructureBoundingBox);
                    PlaceBlockAtCurrentPosition(par1World, Block.StairsNetherBrick.BlockID, i, 2, k + 1, i1, par3StructureBoundingBox);
                    PlaceBlockAtCurrentPosition(par1World, Block.StairsNetherBrick.BlockID, i, 3, k + 1, i1, par3StructureBoundingBox);
                }

                FillWithBlocks(par1World, par3StructureBoundingBox, 0, l, i1, 4, l, i1, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 0, k + 1, i1, 0, l - 1, i1, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 4, k + 1, i1, 4, l - 1, i1, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);

                if ((j & 1) == 0)
                {
                    FillWithBlocks(par1World, par3StructureBoundingBox, 0, k + 2, i1, 0, k + 3, i1, Block.NetherFence.BlockID, Block.NetherFence.BlockID, false);
                    FillWithBlocks(par1World, par3StructureBoundingBox, 4, k + 2, i1, 4, k + 3, i1, Block.NetherFence.BlockID, Block.NetherFence.BlockID, false);
                }

                for (int j1 = 0; j1 <= 4; j1++)
                {
                    FillCurrentPositionBlocksDownwards(par1World, Block.NetherBrick.BlockID, 0, j1, -1, i1, par3StructureBoundingBox);
                }
            }

            return(true);
        }
        /// <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);
            }
        }
Example #8
0
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (IsLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox))
            {
                return(false);
            }
            else
            {
                if (!Field_35036_a)
                {
                    ;
                }

                FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 10, 4, true, par2Random, StructureStrongholdPieces.GetStrongholdStones());
                PlaceDoor(par1World, par2Random, par3StructureBoundingBox, DoorType, 1, 7, 0);
                PlaceDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 4);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 2, 6, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 1, 5, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 0, 1, 6, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 1, 5, 2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 1, 4, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 0, 1, 5, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 2, 4, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 3, 3, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 0, 3, 4, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 3, 3, 2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 3, 2, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 0, 3, 3, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 2, 2, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 1, 1, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 0, 1, 2, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StoneBrick.BlockID, 0, 1, 1, 2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 0, 1, 1, 3, par3StructureBoundingBox);
                return(true);
            }
        }
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            Random random = new Random(FillSeed);

            for (int i = 0; i <= 4; i++)
            {
                for (int i1 = 3; i1 <= 4; i1++)
                {
                    int l1 = random.Next(8);
                    FillWithBlocks(par1World, par3StructureBoundingBox, i, i1, 0, i, i1, l1, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
                }
            }

            int j = random.Next(8);

            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 0, 5, j, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            j = random.Next(8);
            FillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 0, 4, 5, j, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);

            for (int k = 0; k <= 4; k++)
            {
                int j1 = random.Next(5);
                FillWithBlocks(par1World, par3StructureBoundingBox, k, 2, 0, k, 2, j1, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
            }

            for (int l = 0; l <= 4; l++)
            {
                for (int k1 = 0; k1 <= 1; k1++)
                {
                    int i2 = random.Next(3);
                    FillWithBlocks(par1World, par3StructureBoundingBox, l, k1, 0, l, k1, i2, Block.NetherBrick.BlockID, Block.NetherBrick.BlockID, false);
                }
            }

            return(true);
        }
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (IsLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox))
            {
                return(false);
            }

            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 6, true, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            PlaceDoor(par1World, par2Random, par3StructureBoundingBox, DoorType, 1, 1, 0);
            PlaceDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 6);
            FillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 2, 3, 1, 4, Block.StoneBrick.BlockID, Block.StoneBrick.BlockID, false);
            PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 5, 3, 1, 1, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 5, 3, 1, 5, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 5, 3, 2, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 5, 3, 2, 4, par3StructureBoundingBox);

            for (int i = 2; i <= 4; i++)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.StairSingle.BlockID, 5, 2, 1, i, par3StructureBoundingBox);
            }

            if (!HasMadeChest)
            {
                int j = GetYWithOffset(2);
                int k = GetXWithOffset(3, 3);
                int l = GetZWithOffset(3, 3);

                if (par3StructureBoundingBox.IsVecInside(k, j, l))
                {
                    HasMadeChest = true;
                    CreateTreasureChestAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 3, 2, 3, ChestLoot, 2 + par2Random.Next(2));
                }
            }

            return(true);
        }
Example #11
0
 /// <summary>
 /// Returns whether the given bounding box intersects with this one. Args: structureboundingbox
 /// </summary>
 public bool IntersectsWith(StructureBoundingBox par1StructureBoundingBox)
 {
     return(MaxX >= par1StructureBoundingBox.MinX && MinX <= par1StructureBoundingBox.MaxX && MaxZ >= par1StructureBoundingBox.MinZ && MinZ <= par1StructureBoundingBox.MaxZ && MaxY >= par1StructureBoundingBox.MinY && MinY <= par1StructureBoundingBox.MaxY);
 }
Example #12
0
 public ComponentStrongholdCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) : base(par1)
 {
     CoordBaseMode = par4;
     BoundingBox   = par3StructureBoundingBox;
     Field_35052_a = par4 != 2 && par4 != 0 ? par3StructureBoundingBox.GetXSize() : par3StructureBoundingBox.GetZSize();
 }
 public ComponentVillageChurch(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) : base(par1)
 {
     AverageGroundLevel = -1;
     CoordBaseMode      = par4;
     BoundingBox        = par3StructureBoundingBox;
 }
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (AverageGroundLevel < 0)
            {
                AverageGroundLevel = GetAverageGroundLevel(par1World, par3StructureBoundingBox);

                if (AverageGroundLevel < 0)
                {
                    return(true);
                }

                BoundingBox.Offset(0, ((AverageGroundLevel - BoundingBox.MaxY) + 12) - 1, 0);
            }

            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 3, 3, 7, 0, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 3, 9, 3, 0, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 3, 0, 8, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 0, 3, 10, 0, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 10, 3, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 10, 3, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 4, 0, 4, 7, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 4, 4, 4, 7, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 8, 3, 4, 8, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 4, 3, 10, 4, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 5, 3, 5, 7, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 9, 0, 4, 9, 4, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 0, 4, 4, 4, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 0, 11, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 4, 11, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 2, 11, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 2, 11, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 1, 1, 6, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 1, 1, 7, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 2, 1, 7, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 3, 1, 6, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 3, 1, 7, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactCobblestone.BlockID, GetMetadataWithOffset(Block.StairCompactCobblestone.BlockID, 3), 1, 1, 5, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactCobblestone.BlockID, GetMetadataWithOffset(Block.StairCompactCobblestone.BlockID, 3), 2, 1, 6, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactCobblestone.BlockID, GetMetadataWithOffset(Block.StairCompactCobblestone.BlockID, 3), 3, 1, 5, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactCobblestone.BlockID, GetMetadataWithOffset(Block.StairCompactCobblestone.BlockID, 1), 1, 2, 7, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactCobblestone.BlockID, GetMetadataWithOffset(Block.StairCompactCobblestone.BlockID, 0), 3, 2, 7, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 2, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 3, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 4, 2, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 4, 3, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 6, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 7, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 4, 6, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 4, 7, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 2, 6, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 2, 7, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 2, 6, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 2, 7, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 3, 6, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 4, 3, 6, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 2, 3, 8, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, 2, 4, 7, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, 1, 4, 6, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, 3, 4, 6, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, 2, 4, 5, par3StructureBoundingBox);
            int i = GetMetadataWithOffset(Block.Ladder.BlockID, 4);

            for (int j = 1; j <= 9; j++)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, i, 3, j, 3, par3StructureBoundingBox);
            }

            PlaceBlockAtCurrentPosition(par1World, 0, 0, 2, 1, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, 0, 0, 2, 2, 0, par3StructureBoundingBox);
            PlaceDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 2, 1, 0, GetMetadataWithOffset(Block.DoorWood.BlockID, 1));

            if (GetBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && GetBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.StairCompactCobblestone.BlockID, GetMetadataWithOffset(Block.StairCompactCobblestone.BlockID, 3), 2, 0, -1, par3StructureBoundingBox);
            }

            for (int k = 0; k < 9; k++)
            {
                for (int l = 0; l < 5; l++)
                {
                    ClearCurrentPositionBlocksUpwards(par1World, l, 12, k, par3StructureBoundingBox);
                    FillCurrentPositionBlocksDownwards(par1World, Block.Cobblestone.BlockID, 0, l, -1, k, par3StructureBoundingBox);
                }
            }

            SpawnVillagers(par1World, par3StructureBoundingBox, 2, 1, 2, 1);
            return(true);
        }
        private static ComponentStronghold GetNextComponent(ComponentStrongholdStairs2 par0ComponentStrongholdStairs2, List <StructureComponent> par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7)
        {
            if (!CanAddStructurePieces())
            {
                return(null);
            }
            else
            {
                if (StrongComponentType != null)
                {
                    ComponentStronghold var8 = GetStrongholdComponentFromWeightedPiece(StrongComponentType, par1List, par2Random, par3, par4, par5, par6, par7);
                    StrongComponentType = null;

                    if (var8 != null)
                    {
                        return(var8);
                    }
                }

                int var13 = 0;

                while (var13 < 5)
                {
                    ++var13;
                    int var9 = par2Random.Next(TotalWeight);
                    IEnumerator <StructureStrongholdPieceWeight> var10 = StructurePieceList.GetEnumerator();

                    while (var10.MoveNext())
                    {
                        StructureStrongholdPieceWeight var11 = var10.Current;
                        var9 -= var11.PieceWeight;

                        if (var9 < 0)
                        {
                            if (!var11.CanSpawnMoreStructuresOfType(par7) || var11 == par0ComponentStrongholdStairs2.Field_35038_a)
                            {
                                break;
                            }

                            ComponentStronghold var12 = GetStrongholdComponentFromWeightedPiece(var11.PieceClass, par1List, par2Random, par3, par4, par5, par6, par7);

                            if (var12 != null)
                            {
                                ++var11.InstancesSpawned;
                                par0ComponentStrongholdStairs2.Field_35038_a = var11;

                                if (!var11.CanSpawnMoreStructures())
                                {
                                    StructurePieceList.Remove(var11);
                                }

                                return(var12);
                            }
                        }
                    }
                }

                StructureBoundingBox var14 = ComponentStrongholdCorridor.Func_35051_a(par1List, par2Random, par3, par4, par5, par6);

                if (var14 != null && var14.MinY > 1)
                {
                    return(new ComponentStrongholdCorridor(par7, par2Random, var14, par6));
                }
                else
                {
                    return(null);
                }
            }
        }
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (AverageGroundLevel < 0)
            {
                AverageGroundLevel = GetAverageGroundLevel(par1World, par3StructureBoundingBox);

                if (AverageGroundLevel < 0)
                {
                    return(true);
                }

                BoundingBox.Offset(0, ((AverageGroundLevel - BoundingBox.MaxY) + 9) - 1, 0);
            }

            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 7, 5, 4, 0, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 8, 0, 5, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 8, 5, 5, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 1, 8, 6, 4, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 7, 2, 8, 7, 3, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            int i = GetMetadataWithOffset(Block.StairCompactPlanks.BlockID, 3);
            int j = GetMetadataWithOffset(Block.StairCompactPlanks.BlockID, 2);

            for (int k = -1; k <= 2; k++)
            {
                for (int i1 = 0; i1 <= 8; i1++)
                {
                    PlaceBlockAtCurrentPosition(par1World, Block.StairCompactPlanks.BlockID, i, i1, 6 + k, k, par3StructureBoundingBox);
                    PlaceBlockAtCurrentPosition(par1World, Block.StairCompactPlanks.BlockID, j, i1, 6 + k, 5 - k, par3StructureBoundingBox);
                }
            }

            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 0, 1, 5, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 5, 8, 1, 5, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 8, 1, 0, 8, 1, 4, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 2, 1, 0, 7, 1, 0, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 4, 0, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 5, 0, 4, 5, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 8, 2, 5, 8, 4, 5, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 8, 2, 0, 8, 4, 0, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 1, 0, 4, 4, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 5, 7, 4, 5, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 8, 2, 1, 8, 4, 4, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 0, 7, 4, 0, Block.Planks.BlockID, Block.Planks.BlockID, false);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 4, 2, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 5, 2, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 6, 2, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 4, 3, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 5, 3, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 6, 3, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 2, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 2, 3, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 3, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 3, 3, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 8, 2, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 8, 2, 3, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 8, 3, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 8, 3, 3, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 2, 2, 5, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 3, 2, 5, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 5, 2, 5, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 6, 2, 5, par3StructureBoundingBox);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 1, 7, 4, 1, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 4, 7, 4, 4, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 4, 7, 3, 4, Block.BookShelf.BlockID, Block.BookShelf.BlockID, false);
            PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 7, 1, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactPlanks.BlockID, GetMetadataWithOffset(Block.StairCompactPlanks.BlockID, 0), 7, 1, 3, par3StructureBoundingBox);
            int l = GetMetadataWithOffset(Block.StairCompactPlanks.BlockID, 3);

            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactPlanks.BlockID, l, 6, 1, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactPlanks.BlockID, l, 5, 1, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactPlanks.BlockID, l, 4, 1, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.StairCompactPlanks.BlockID, l, 3, 1, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 6, 1, 3, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.PressurePlatePlanks.BlockID, 0, 6, 2, 3, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 4, 1, 3, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.PressurePlatePlanks.BlockID, 0, 4, 2, 3, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Workbench.BlockID, 0, 7, 1, 1, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, 0, 0, 1, 1, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, 0, 0, 1, 2, 0, par3StructureBoundingBox);
            PlaceDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 1, 1, 0, GetMetadataWithOffset(Block.DoorWood.BlockID, 1));

            if (GetBlockIdAtCurrentPosition(par1World, 1, 0, -1, par3StructureBoundingBox) == 0 && GetBlockIdAtCurrentPosition(par1World, 1, -1, -1, par3StructureBoundingBox) != 0)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.StairCompactCobblestone.BlockID, GetMetadataWithOffset(Block.StairCompactCobblestone.BlockID, 3), 1, 0, -1, par3StructureBoundingBox);
            }

            for (int j1 = 0; j1 < 6; j1++)
            {
                for (int k1 = 0; k1 < 9; k1++)
                {
                    ClearCurrentPositionBlocksUpwards(par1World, k1, 9, j1, par3StructureBoundingBox);
                    FillCurrentPositionBlocksDownwards(par1World, Block.Cobblestone.BlockID, 0, k1, -1, j1, par3StructureBoundingBox);
                }
            }

            SpawnVillagers(par1World, par3StructureBoundingBox, 2, 1, 2, 1);
            return(true);
        }
 public ComponentMineshaftRoom(int par1, Random par2Random, int par3, int par4) : base(par1)
 {
     ChidStructures = new LinkedList <StructureBoundingBox>();
     BoundingBox    = new StructureBoundingBox(par3, 50, par4, par3 + 7 + par2Random.Next(6), 54 + par2Random.Next(6), par4 + 7 + par2Random.Next(6));
 }
 public ComponentStrongholdStairsStraight(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) : base(par1)
 {
     CoordBaseMode = par4;
     DoorType      = GetRandomDoor(par2Random);
     BoundingBox   = par3StructureBoundingBox;
 }
 public ComponentMineshaftStairs(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) : base(par1)
 {
     CoordBaseMode = par4;
     BoundingBox   = par3StructureBoundingBox;
 }
Example #20
0
 public ComponentStrongholdRightTurn(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) : base(par1, par2Random, par3StructureBoundingBox, par4)
 {
 }
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 10, 7, 15, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            PlaceDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.GRATES, 4, 1, 0);
            sbyte byte0 = 6;

            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, byte0, 1, 1, byte0, 14, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, byte0, 1, 9, byte0, 14, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, byte0, 1, 8, byte0, 2, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, byte0, 14, 8, byte0, 14, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 2, 1, 4, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 8, 1, 1, 9, 1, 4, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 1, 1, 3, Block.LavaMoving.BlockID, Block.LavaMoving.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, 1, 9, 1, 3, Block.LavaMoving.BlockID, Block.LavaMoving.BlockID, false);
            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 3, 1, 8, 7, 1, 12, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            FillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 9, 6, 1, 11, Block.LavaMoving.BlockID, Block.LavaMoving.BlockID, false);

            for (int j = 3; j < 14; j += 2)
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, j, 0, 4, j, Block.FenceIron.BlockID, Block.FenceIron.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 10, 3, j, 10, 4, j, Block.FenceIron.BlockID, Block.FenceIron.BlockID, false);
            }

            for (int k = 2; k < 9; k += 2)
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, k, 3, 15, k, 4, 15, Block.FenceIron.BlockID, Block.FenceIron.BlockID, false);
            }

            int l = GetMetadataWithOffset(Block.StairsStoneBrickSmooth.BlockID, 3);

            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 5, 6, 1, 7, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 2, 6, 6, 2, 7, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 3, 7, 6, 3, 7, false, par2Random, StructureStrongholdPieces.GetStrongholdStones());

            for (int i1 = 4; i1 <= 6; i1++)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.StairsStoneBrickSmooth.BlockID, l, i1, 1, 4, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StairsStoneBrickSmooth.BlockID, l, i1, 2, 5, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.StairsStoneBrickSmooth.BlockID, l, i1, 3, 6, par3StructureBoundingBox);
            }

            sbyte byte1 = 2;
            sbyte byte2 = 0;
            sbyte byte3 = 3;
            sbyte byte4 = 1;

            switch (CoordBaseMode)
            {
            case 0:
                byte1 = 0;
                byte2 = 2;
                break;

            case 3:
                byte1 = 3;
                byte2 = 1;
                byte3 = 0;
                byte4 = 2;
                break;

            case 1:
                byte1 = 1;
                byte2 = 3;
                byte3 = 0;
                byte4 = 2;
                break;
            }

            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte1 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 4, 3, 8, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte1 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 5, 3, 8, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte1 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 6, 3, 8, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte2 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 4, 3, 12, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte2 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 5, 3, 12, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte2 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 6, 3, 12, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte3 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 3, 3, 9, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte3 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 3, 3, 10, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte3 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 3, 3, 11, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte4 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 7, 3, 9, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte4 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 7, 3, 10, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.EndPortalFrame.BlockID, byte4 + (par2Random.NextFloat() <= 0.9F ? 0 : 4), 7, 3, 11, par3StructureBoundingBox);

            if (!HasSpawner)
            {
                int i  = GetYWithOffset(3);
                int j1 = GetXWithOffset(5, 6);
                int k1 = GetZWithOffset(5, 6);

                if (par3StructureBoundingBox.IsVecInside(j1, i, k1))
                {
                    HasSpawner = true;
                    par1World.SetBlockWithNotify(j1, i, k1, Block.MobSpawner.BlockID);
                    TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)par1World.GetBlockTileEntity(j1, i, k1);

                    if (tileentitymobspawner != null)
                    {
                        tileentitymobspawner.SetMobID("Silverfish");
                    }
                }
            }

            return(true);
        }
Example #22
0
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (IsLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox))
            {
                return(false);
            }

            sbyte byte0 = 11;

            if (!IsLargeRoom)
            {
                byte0 = 6;
            }

            FillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 13, byte0 - 1, 14, true, par2Random, StructureStrongholdPieces.GetStrongholdStones());
            PlaceDoor(par1World, par2Random, par3StructureBoundingBox, DoorType, 4, 1, 0);
            RandomlyFillWithBlocks(par1World, par3StructureBoundingBox, par2Random, 0.07F, 2, 1, 1, 11, 4, 13, Block.Web.BlockID, Block.Web.BlockID, false);

            for (int i = 1; i <= 13; i++)
            {
                if ((i - 1) % 4 == 0)
                {
                    FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, i, 1, 4, i, Block.Planks.BlockID, Block.Planks.BlockID, false);
                    FillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, i, 12, 4, i, Block.Planks.BlockID, Block.Planks.BlockID, false);
                    PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, 2, 3, i, par3StructureBoundingBox);
                    PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, 11, 3, i, par3StructureBoundingBox);

                    if (IsLargeRoom)
                    {
                        FillWithBlocks(par1World, par3StructureBoundingBox, 1, 6, i, 1, 9, i, Block.Planks.BlockID, Block.Planks.BlockID, false);
                        FillWithBlocks(par1World, par3StructureBoundingBox, 12, 6, i, 12, 9, i, Block.Planks.BlockID, Block.Planks.BlockID, false);
                    }

                    continue;
                }

                FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, i, 1, 4, i, Block.BookShelf.BlockID, Block.BookShelf.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, i, 12, 4, i, Block.BookShelf.BlockID, Block.BookShelf.BlockID, false);

                if (IsLargeRoom)
                {
                    FillWithBlocks(par1World, par3StructureBoundingBox, 1, 6, i, 1, 9, i, Block.BookShelf.BlockID, Block.BookShelf.BlockID, false);
                    FillWithBlocks(par1World, par3StructureBoundingBox, 12, 6, i, 12, 9, i, Block.BookShelf.BlockID, Block.BookShelf.BlockID, false);
                }
            }

            for (int j = 3; j < 12; j += 2)
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, j, 4, 3, j, Block.BookShelf.BlockID, Block.BookShelf.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 6, 1, j, 7, 3, j, Block.BookShelf.BlockID, Block.BookShelf.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, j, 10, 3, j, Block.BookShelf.BlockID, Block.BookShelf.BlockID, false);
            }

            if (IsLargeRoom)
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 3, 5, 13, Block.Planks.BlockID, Block.Planks.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 10, 5, 1, 12, 5, 13, Block.Planks.BlockID, Block.Planks.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 1, 9, 5, 2, Block.Planks.BlockID, Block.Planks.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 12, 9, 5, 13, Block.Planks.BlockID, Block.Planks.BlockID, false);
                PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 9, 5, 11, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 8, 5, 11, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 9, 5, 10, par3StructureBoundingBox);
                FillWithBlocks(par1World, par3StructureBoundingBox, 3, 6, 2, 3, 6, 12, Block.Fence.BlockID, Block.Fence.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 10, 6, 2, 10, 6, 10, Block.Fence.BlockID, Block.Fence.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 4, 6, 2, 9, 6, 2, Block.Fence.BlockID, Block.Fence.BlockID, false);
                FillWithBlocks(par1World, par3StructureBoundingBox, 4, 6, 12, 8, 6, 12, Block.Fence.BlockID, Block.Fence.BlockID, false);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 9, 6, 11, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 8, 6, 11, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 9, 6, 10, par3StructureBoundingBox);
                int k = GetMetadataWithOffset(Block.Ladder.BlockID, 3);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, k, 10, 1, 13, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, k, 10, 2, 13, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, k, 10, 3, 13, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, k, 10, 4, 13, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, k, 10, 5, 13, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, k, 10, 6, 13, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, k, 10, 7, 13, par3StructureBoundingBox);
                sbyte byte1 = 7;
                sbyte byte2 = 7;
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1 - 1, 9, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1, 9, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1 - 1, 8, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1, 8, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1 - 1, 7, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1, 7, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1 - 2, 7, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1 + 1, 7, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1 - 1, 7, byte2 - 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1 - 1, 7, byte2 + 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1, 7, byte2 - 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, byte1, 7, byte2 + 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, byte1 - 2, 8, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, byte1 + 1, 8, byte2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, byte1 - 1, 8, byte2 - 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, byte1 - 1, 8, byte2 + 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, byte1, 8, byte2 - 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, byte1, 8, byte2 + 1, par3StructureBoundingBox);
            }

            CreateTreasureChestAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 3, 3, 5, Field_35056_b, 1 + par2Random.Next(4));

            if (IsLargeRoom)
            {
                PlaceBlockAtCurrentPosition(par1World, 0, 0, 12, 9, 1, par3StructureBoundingBox);
                CreateTreasureChestAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 12, 8, 1, Field_35056_b, 1 + par2Random.Next(4));
            }

            return(true);
        }
Example #23
0
 protected static bool CanVillageGoDeeper(StructureBoundingBox par0StructureBoundingBox)
 {
     return(par0StructureBoundingBox != null && par0StructureBoundingBox.MinY > 10);
 }
Example #24
0
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (AverageGroundLevel < 0)
            {
                AverageGroundLevel = GetAverageGroundLevel(par1World, par3StructureBoundingBox);

                if (AverageGroundLevel < 0)
                {
                    return(true);
                }

                BoundingBox.Offset(0, ((AverageGroundLevel - BoundingBox.MaxY) + 6) - 1, 0);
            }

            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 0, 4, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 0, 4, 4, 4, Block.Wood.BlockID, Block.Wood.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 1, 3, 4, 3, Block.Planks.BlockID, Block.Planks.BlockID, false);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 0, 1, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 0, 2, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 0, 3, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 4, 1, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 4, 2, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 4, 3, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 0, 1, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 0, 2, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 0, 3, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 4, 1, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 4, 2, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Cobblestone.BlockID, 0, 4, 3, 4, par3StructureBoundingBox);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 3, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 4, 3, 3, 4, Block.Planks.BlockID, Block.Planks.BlockID, false);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 2, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 2, 2, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 4, 2, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 1, 1, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 1, 2, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 1, 3, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 2, 3, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 3, 3, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 3, 2, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Planks.BlockID, 0, 3, 1, 0, par3StructureBoundingBox);

            if (GetBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && GetBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.StairCompactCobblestone.BlockID, GetMetadataWithOffset(Block.StairCompactCobblestone.BlockID, 3), 2, 0, -1, par3StructureBoundingBox);
            }

            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 3, 3, 3, 0, 0, false);

            if (IsRoofAccessible)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 0, 5, 0, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 1, 5, 0, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 2, 5, 0, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 3, 5, 0, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 4, 5, 0, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 0, 5, 4, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 1, 5, 4, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 2, 5, 4, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 3, 5, 4, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 4, 5, 4, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 4, 5, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 4, 5, 2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 4, 5, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 0, 5, 1, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 0, 5, 2, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, 0, 5, 3, par3StructureBoundingBox);
            }

            if (IsRoofAccessible)
            {
                int i = GetMetadataWithOffset(Block.Ladder.BlockID, 3);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, i, 3, 1, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, i, 3, 2, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, i, 3, 3, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.Ladder.BlockID, i, 3, 4, 3, par3StructureBoundingBox);
            }

            PlaceBlockAtCurrentPosition(par1World, Block.TorchWood.BlockID, 0, 2, 3, 1, par3StructureBoundingBox);

            for (int j = 0; j < 5; j++)
            {
                for (int k = 0; k < 5; k++)
                {
                    ClearCurrentPositionBlocksUpwards(par1World, k, 6, j, par3StructureBoundingBox);
                    FillCurrentPositionBlocksDownwards(par1World, Block.Cobblestone.BlockID, 0, k, -1, j, par3StructureBoundingBox);
                }
            }

            SpawnVillagers(par1World, par3StructureBoundingBox, 1, 1, 2, 1);
            return(true);
        }
 public ComponentStrongholdPortalRoom(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) : base(par1)
 {
     CoordBaseMode = par4;
     BoundingBox   = par3StructureBoundingBox;
 }
 public ComponentNetherBridgeEnd(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) : base(par1)
 {
     CoordBaseMode = par4;
     BoundingBox   = par3StructureBoundingBox;
     FillSeed      = par2Random.Next();
 }
Example #27
0
 public ComponentNetherBridgeCrossing2(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) : base(par1)
 {
     CoordBaseMode = par4;
     BoundingBox   = par3StructureBoundingBox;
 }
Example #28
0
        /// <summary>
        /// 'second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
        /// the end, it adds Fences...'
        /// </summary>
        public override bool AddComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
        {
            if (AverageGroundLevel < 0)
            {
                AverageGroundLevel = GetAverageGroundLevel(par1World, par3StructureBoundingBox);

                if (AverageGroundLevel < 0)
                {
                    return(true);
                }

                BoundingBox.Offset(0, ((AverageGroundLevel - BoundingBox.MaxY) + 6) - 1, 0);
            }

            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 3, 5, 4, 0, 0, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 3, 0, 4, Block.Cobblestone.BlockID, Block.Cobblestone.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 3, Block.Dirt.BlockID, Block.Dirt.BlockID, false);

            if (IsTallHouse)
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 1, 2, 4, 3, Block.Wood.BlockID, Block.Wood.BlockID, false);
            }
            else
            {
                FillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 2, 5, 3, Block.Wood.BlockID, Block.Wood.BlockID, false);
            }

            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 1, 4, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 2, 4, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 1, 4, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 2, 4, 4, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 0, 4, 1, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 0, 4, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 0, 4, 3, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 3, 4, 1, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 3, 4, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.Wood.BlockID, 0, 3, 4, 3, par3StructureBoundingBox);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 0, 3, 0, Block.Wood.BlockID, Block.Wood.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 0, 3, 3, 0, Block.Wood.BlockID, Block.Wood.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 4, 0, 3, 4, Block.Wood.BlockID, Block.Wood.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 4, 3, 3, 4, Block.Wood.BlockID, Block.Wood.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 1, 3, 3, 3, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 0, 2, 3, 0, Block.Planks.BlockID, Block.Planks.BlockID, false);
            FillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 4, 2, 3, 4, Block.Planks.BlockID, Block.Planks.BlockID, false);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 0, 2, 2, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, Block.ThinGlass.BlockID, 0, 3, 2, 2, par3StructureBoundingBox);

            if (TablePosition > 0)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.Fence.BlockID, 0, TablePosition, 1, 3, par3StructureBoundingBox);
                PlaceBlockAtCurrentPosition(par1World, Block.PressurePlatePlanks.BlockID, 0, TablePosition, 2, 3, par3StructureBoundingBox);
            }

            PlaceBlockAtCurrentPosition(par1World, 0, 0, 1, 1, 0, par3StructureBoundingBox);
            PlaceBlockAtCurrentPosition(par1World, 0, 0, 1, 2, 0, par3StructureBoundingBox);
            PlaceDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 1, 1, 0, GetMetadataWithOffset(Block.DoorWood.BlockID, 1));

            if (GetBlockIdAtCurrentPosition(par1World, 1, 0, -1, par3StructureBoundingBox) == 0 && GetBlockIdAtCurrentPosition(par1World, 1, -1, -1, par3StructureBoundingBox) != 0)
            {
                PlaceBlockAtCurrentPosition(par1World, Block.StairCompactCobblestone.BlockID, GetMetadataWithOffset(Block.StairCompactCobblestone.BlockID, 3), 1, 0, -1, par3StructureBoundingBox);
            }

            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    ClearCurrentPositionBlocksUpwards(par1World, j, 6, i, par3StructureBoundingBox);
                    FillCurrentPositionBlocksDownwards(par1World, Block.Cobblestone.BlockID, 0, j, -1, i, par3StructureBoundingBox);
                }
            }

            SpawnVillagers(par1World, par3StructureBoundingBox, 1, 1, 2, 1);
            return(true);
        }
 public ComponentVillagePathGen(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) : base(par1)
 {
     CoordBaseMode      = par4;
     BoundingBox        = par3StructureBoundingBox;
     AverageGroundLevel = Math.Max(par3StructureBoundingBox.GetXSize(), par3StructureBoundingBox.GetZSize());
 }
        /// <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));
                }
            }
        }