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