    001    package net.minecraft.src;
    002
    003    import java.util.List;
    004    import java.util.Random;
    005
    006    public class ComponentStrongholdStairsStraight extends ComponentStronghold
    007    {
    008        private final EnumDoor doorType;
    009
    010        public ComponentStrongholdStairsStraight(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4)
    011        {
    012            super(par1);
    013            this.coordBaseMode = par4;
    014            this.doorType = this.getRandomDoor(par2Random);
    015            this.boundingBox = par3StructureBoundingBox;
    016        }
    017
    018        /**
    019         * Initiates construction of the Structure Component picked, at the current Location of StructGen
    020         */
    021        public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random)
    022        {
    023            this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1);
    024        }
    025
    026        public static ComponentStrongholdStairsStraight findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
    027        {
    028            StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -7, 0, 5, 11, 8, par5);
    029            return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdStairsStraight(par6, par1Random, var7, par5) : null;
    030        }
    031
    032        /**
    033         * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
    034         * the end, it adds Fences...
    035         */
    036        public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
    037        {
    038            if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox))
    039            {
    040                return false;
    041            }
    042            else
    043            {
    044                this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 10, 7, true, par2Random, StructureStrongholdPieces.getStrongholdStones());
    045                this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.doorType, 1, 7, 0);
    046                this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 7);
    047                int var4 = this.getMetadataWithOffset(Block.stairCompactCobblestone.blockID, 2);
    048
    049                for (int var5 = 0; var5 < 6; ++var5)
    050                {
    051                    this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 1, 6 - var5, 1 + var5, par3StructureBoundingBox);
    052                    this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 2, 6 - var5, 1 + var5, par3StructureBoundingBox);
    053                    this.placeBlockAtCurrentPosition(par1World, Block.stairCompactCobblestone.blockID, var4, 3, 6 - var5, 1 + var5, par3StructureBoundingBox);
    054
    055                    if (var5 < 5)
    056                    {
    057                        this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 5 - var5, 1 + var5, par3StructureBoundingBox);
    058                        this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 5 - var5, 1 + var5, par3StructureBoundingBox);
    059                        this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 5 - var5, 1 + var5, par3StructureBoundingBox);
    060                    }
    061                }
    062
    063                return true;
    064            }
    065        }
    066    }