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