    001    package net.minecraft.src;
    002
    003    import java.util.Random;
    004
    005    public class WorldGenDesertWells extends WorldGenerator
    006    {
    007        public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
    008        {
    009            while (par1World.isAirBlock(par3, par4, par5) && par4 > 2)
    010            {
    011                --par4;
    012            }
    013
    014            int var6 = par1World.getBlockId(par3, par4, par5);
    015
    016            if (var6 != Block.sand.blockID)
    017            {
    018                return false;
    019            }
    020            else
    021            {
    022                int var7;
    023                int var8;
    024
    025                for (var7 = -2; var7 <= 2; ++var7)
    026                {
    027                    for (var8 = -2; var8 <= 2; ++var8)
    028                    {
    029                        if (par1World.isAirBlock(par3 + var7, par4 - 1, par5 + var8) && par1World.isAirBlock(par3 + var7, par4 - 2, par5 + var8))
    030                        {
    031                            return false;
    032                        }
    033                    }
    034                }
    035
    036                for (var7 = -1; var7 <= 0; ++var7)
    037                {
    038                    for (var8 = -2; var8 <= 2; ++var8)
    039                    {
    040                        for (int var9 = -2; var9 <= 2; ++var9)
    041                        {
    042                            par1World.setBlock(par3 + var8, par4 + var7, par5 + var9, Block.sandStone.blockID);
    043                        }
    044                    }
    045                }
    046
    047                par1World.setBlock(par3, par4, par5, Block.waterMoving.blockID);
    048                par1World.setBlock(par3 - 1, par4, par5, Block.waterMoving.blockID);
    049                par1World.setBlock(par3 + 1, par4, par5, Block.waterMoving.blockID);
    050                par1World.setBlock(par3, par4, par5 - 1, Block.waterMoving.blockID);
    051                par1World.setBlock(par3, par4, par5 + 1, Block.waterMoving.blockID);
    052
    053                for (var7 = -2; var7 <= 2; ++var7)
    054                {
    055                    for (var8 = -2; var8 <= 2; ++var8)
    056                    {
    057                        if (var7 == -2 || var7 == 2 || var8 == -2 || var8 == 2)
    058                        {
    059                            par1World.setBlock(par3 + var7, par4 + 1, par5 + var8, Block.sandStone.blockID);
    060                        }
    061                    }
    062                }
    063
    064                par1World.setBlockAndMetadata(par3 + 2, par4 + 1, par5, Block.stoneSingleSlab.blockID, 1);
    065                par1World.setBlockAndMetadata(par3 - 2, par4 + 1, par5, Block.stoneSingleSlab.blockID, 1);
    066                par1World.setBlockAndMetadata(par3, par4 + 1, par5 + 2, Block.stoneSingleSlab.blockID, 1);
    067                par1World.setBlockAndMetadata(par3, par4 + 1, par5 - 2, Block.stoneSingleSlab.blockID, 1);
    068
    069                for (var7 = -1; var7 <= 1; ++var7)
    070                {
    071                    for (var8 = -1; var8 <= 1; ++var8)
    072                    {
    073                        if (var7 == 0 && var8 == 0)
    074                        {
    075                            par1World.setBlock(par3 + var7, par4 + 4, par5 + var8, Block.sandStone.blockID);
    076                        }
    077                        else
    078                        {
    079                            par1World.setBlockAndMetadata(par3 + var7, par4 + 4, par5 + var8, Block.stoneSingleSlab.blockID, 1);
    080                        }
    081                    }
    082                }
    083
    084                for (var7 = 1; var7 <= 3; ++var7)
    085                {
    086                    par1World.setBlock(par3 - 1, par4 + var7, par5 - 1, Block.sandStone.blockID);
    087                    par1World.setBlock(par3 - 1, par4 + var7, par5 + 1, Block.sandStone.blockID);
    088                    par1World.setBlock(par3 + 1, par4 + var7, par5 - 1, Block.sandStone.blockID);
    089                    par1World.setBlock(par3 + 1, par4 + var7, par5 + 1, Block.sandStone.blockID);
    090                }
    091
    092                return true;
    093            }
    094        }
    095    }