    001    package net.minecraft.src;
    002
    003    import java.util.Random;
    004
    005    public class WorldGenDeadBush extends WorldGenerator
    006    {
    007        /** stores the ID for WorldGenDeadBush */
    008        private int deadBushID;
    009
    010        public WorldGenDeadBush(int par1)
    011        {
    012            this.deadBushID = par1;
    013        }
    014
    015        public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
    016        {
    017            int var11;
    018
    019            Block block = null;
    020            do
    021            {
    022                block = Block.blocksList[par1World.getBlockId(par3,  par4, par5)];
    023                if (block != null && !block.isLeaves(par1World, par3, par4, par5))
    024                {
    025                    break;
    026                }
    027                par4--;
    028            } while (par4 > 0);
    029
    030            for (int var7 = 0; var7 < 4; ++var7)
    031            {
    032                int var8 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
    033                int var9 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
    034                int var10 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
    035
    036                if (par1World.isAirBlock(var8, var9, var10) && Block.blocksList[this.deadBushID].canBlockStay(par1World, var8, var9, var10))
    037                {
    038                    par1World.setBlock(var8, var9, var10, this.deadBushID);
    039                }
    040            }
    041
    042            return true;
    043        }
    044    }