    001    package net.minecraft.src;
    002
    003    import java.util.Random;
    004
    005    public class WorldGenGlowStone2 extends WorldGenerator
    006    {
    007        public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
    008        {
    009            if (!par1World.isAirBlock(par3, par4, par5))
    010            {
    011                return false;
    012            }
    013            else if (par1World.getBlockId(par3, par4 + 1, par5) != Block.netherrack.blockID)
    014            {
    015                return false;
    016            }
    017            else
    018            {
    019                par1World.setBlockWithNotify(par3, par4, par5, Block.glowStone.blockID);
    020
    021                for (int var6 = 0; var6 < 1500; ++var6)
    022                {
    023                    int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
    024                    int var8 = par4 - par2Random.nextInt(12);
    025                    int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
    026
    027                    if (par1World.getBlockId(var7, var8, var9) == 0)
    028                    {
    029                        int var10 = 0;
    030
    031                        for (int var11 = 0; var11 < 6; ++var11)
    032                        {
    033                            int var12 = 0;
    034
    035                            if (var11 == 0)
    036                            {
    037                                var12 = par1World.getBlockId(var7 - 1, var8, var9);
    038                            }
    039
    040                            if (var11 == 1)
    041                            {
    042                                var12 = par1World.getBlockId(var7 + 1, var8, var9);
    043                            }
    044
    045                            if (var11 == 2)
    046                            {
    047                                var12 = par1World.getBlockId(var7, var8 - 1, var9);
    048                            }
    049
    050                            if (var11 == 3)
    051                            {
    052                                var12 = par1World.getBlockId(var7, var8 + 1, var9);
    053                            }
    054
    055                            if (var11 == 4)
    056                            {
    057                                var12 = par1World.getBlockId(var7, var8, var9 - 1);
    058                            }
    059
    060                            if (var11 == 5)
    061                            {
    062                                var12 = par1World.getBlockId(var7, var8, var9 + 1);
    063                            }
    064
    065                            if (var12 == Block.glowStone.blockID)
    066                            {
    067                                ++var10;
    068                            }
    069                        }
    070
    071                        if (var10 == 1)
    072                        {
    073                            par1World.setBlockWithNotify(var7, var8, var9, Block.glowStone.blockID);
    074                        }
    075                    }
    076                }
    077
    078                return true;
    079            }
    080        }
    081    }