    001    package net.minecraft.src;
    002
    003    import java.util.List;
    004    import java.util.Random;
    005
    006    public class ComponentStrongholdCorridor extends ComponentStronghold
    007    {
    008        private final int field_74993_a;
    009
    010        public ComponentStrongholdCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4)
    011        {
    012            super(par1);
    013            this.coordBaseMode = par4;
    014            this.boundingBox = par3StructureBoundingBox;
    015            this.field_74993_a = par4 != 2 && par4 != 0 ? par3StructureBoundingBox.getXSize() : par3StructureBoundingBox.getZSize();
    016        }
    017
    018        public static StructureBoundingBox func_74992_a(List par0List, Random par1Random, int par2, int par3, int par4, int par5)
    019        {
    020            StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 4, par5);
    021            StructureComponent var8 = StructureComponent.findIntersecting(par0List, var7);
    022
    023            if (var8 == null)
    024            {
    025                return null;
    026            }
    027            else
    028            {
    029                if (var8.getBoundingBox().minY == var7.minY)
    030                {
    031                    for (int var9 = 3; var9 >= 1; --var9)
    032                    {
    033                        var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, var9 - 1, par5);
    034
    035                        if (!var8.getBoundingBox().intersectsWith(var7))
    036                        {
    037                            return StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, var9, par5);
    038                        }
    039                    }
    040                }
    041
    042                return null;
    043            }
    044        }
    045
    046        /**
    047         * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
    048         * the end, it adds Fences...
    049         */
    050        public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
    051        {
    052            if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox))
    053            {
    054                return false;
    055            }
    056            else
    057            {
    058                for (int var4 = 0; var4 < this.field_74993_a; ++var4)
    059                {
    060                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 0, 0, var4, par3StructureBoundingBox);
    061                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 0, var4, par3StructureBoundingBox);
    062                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 0, var4, par3StructureBoundingBox);
    063                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 0, var4, par3StructureBoundingBox);
    064                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 4, 0, var4, par3StructureBoundingBox);
    065
    066                    for (int var5 = 1; var5 <= 3; ++var5)
    067                    {
    068                        this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 0, var5, var4, par3StructureBoundingBox);
    069                        this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, var5, var4, par3StructureBoundingBox);
    070                        this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, var5, var4, par3StructureBoundingBox);
    071                        this.placeBlockAtCurrentPosition(par1World, 0, 0, 3, var5, var4, par3StructureBoundingBox);
    072                        this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 4, var5, var4, par3StructureBoundingBox);
    073                    }
    074
    075                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 0, 4, var4, par3StructureBoundingBox);
    076                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 4, var4, par3StructureBoundingBox);
    077                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 4, var4, par3StructureBoundingBox);
    078                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 4, var4, par3StructureBoundingBox);
    079                    this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 4, 4, var4, par3StructureBoundingBox);
    080                }
    081
    082                return true;
    083            }
    084        }
    085    }