    001    package net.minecraft.src;
    002
    003    import java.util.List;
    004    import java.util.Random;
    005
    006    public class ComponentNetherBridgeCorridor3 extends ComponentNetherBridgePiece
    007    {
    008        public ComponentNetherBridgeCorridor3(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4)
    009        {
    010            super(par1);
    011            this.coordBaseMode = par4;
    012            this.boundingBox = par3StructureBoundingBox;
    013        }
    014
    015        /**
    016         * Initiates construction of the Structure Component picked, at the current Location of StructGen
    017         */
    018        public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random)
    019        {
    020            this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 0, true);
    021        }
    022
    023        /**
    024         * Creates and returns a new component piece. Or null if it could not find enough room to place it.
    025         */
    026        public static ComponentNetherBridgeCorridor3 createValidComponent(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, 14, 10, par5);
    029            return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor3(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            int var4 = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 2);
    039
    040            for (int var5 = 0; var5 <= 9; ++var5)
    041            {
    042                int var6 = Math.max(1, 7 - var5);
    043                int var7 = Math.min(Math.max(var6 + 5, 14 - var5), 13);
    044                int var8 = var5;
    045                this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, var5, 4, var6, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
    046                this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, var6 + 1, var5, 3, var7 - 1, var5, 0, 0, false);
    047
    048                if (var5 <= 6)
    049                {
    050                    this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, 1, var6 + 1, var5, par3StructureBoundingBox);
    051                    this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, 2, var6 + 1, var5, par3StructureBoundingBox);
    052                    this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, 3, var6 + 1, var5, par3StructureBoundingBox);
    053                }
    054
    055                this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, var7, var5, 4, var7, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
    056                this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, var6 + 1, var5, 0, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
    057                this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, var6 + 1, var5, 4, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
    058
    059                if ((var5 & 1) == 0)
    060                {
    061                    this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, var6 + 2, var5, 0, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false);
    062                    this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, var6 + 2, var5, 4, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false);
    063                }
    064
    065                for (int var9 = 0; var9 <= 4; ++var9)
    066                {
    067                    this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var9, -1, var8, par3StructureBoundingBox);
    068                }
    069            }
    070
    071            return true;
    072        }
    073    }