    001    package net.minecraft.src;
    002
    003    import java.util.List;
    004    import java.util.Random;
    005
    006    public class ComponentNetherBridgeEnd extends ComponentNetherBridgePiece
    007    {
    008        private int fillSeed;
    009
    010        public ComponentNetherBridgeEnd(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4)
    011        {
    012            super(par1);
    013            this.coordBaseMode = par4;
    014            this.boundingBox = par3StructureBoundingBox;
    015            this.fillSeed = par2Random.nextInt();
    016        }
    017
    018        public static ComponentNetherBridgeEnd func_74971_a(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6)
    019        {
    020            StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -3, 0, 5, 10, 8, par5);
    021            return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeEnd(par6, par1Random, var7, par5) : null;
    022        }
    023
    024        /**
    025         * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
    026         * the end, it adds Fences...
    027         */
    028        public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox)
    029        {
    030            Random var4 = new Random((long)this.fillSeed);
    031            int var5;
    032            int var6;
    033            int var7;
    034
    035            for (var5 = 0; var5 <= 4; ++var5)
    036            {
    037                for (var6 = 3; var6 <= 4; ++var6)
    038                {
    039                    var7 = var4.nextInt(8);
    040                    this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
    041                }
    042            }
    043
    044            var5 = var4.nextInt(8);
    045            this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 0, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
    046            var5 = var4.nextInt(8);
    047            this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 0, 4, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
    048
    049            for (var5 = 0; var5 <= 4; ++var5)
    050            {
    051                var6 = var4.nextInt(5);
    052                this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, 2, 0, var5, 2, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
    053            }
    054
    055            for (var5 = 0; var5 <= 4; ++var5)
    056            {
    057                for (var6 = 0; var6 <= 1; ++var6)
    058                {
    059                    var7 = var4.nextInt(3);
    060                    this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false);
    061                }
    062            }
    063
    064            return true;
    065        }
    066    }