    001    package net.minecraft.src;
    002
    003    import java.util.Random;
    004
    005    public class WorldGenFlowers extends WorldGenerator
    006    {
    007        /** The ID of the plant block used in this plant generator. */
    008        private int plantBlockId;
    009
    010        public WorldGenFlowers(int par1)
    011        {
    012            this.plantBlockId = par1;
    013        }
    014
    015        public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
    016        {
    017            for (int var6 = 0; var6 < 64; ++var6)
    018            {
    019                int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
    020                int var8 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
    021                int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
    022
    023                if (par1World.isAirBlock(var7, var8, var9) && (!par1World.provider.hasNoSky || var8 < 127) && Block.blocksList[this.plantBlockId].canBlockStay(par1World, var7, var8, var9))
    024                {
    025                    par1World.setBlock(var7, var8, var9, this.plantBlockId);
    026                }
    027            }
    028
    029            return true;
    030        }
    031    }