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