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