2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty.worldgen;
|
|
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
|
|
|
|
|
|
|
public class WorldGenMelon extends WorldGenerator
|
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
@Override
|
|
|
|
public boolean generate(World var1, Random var2, int var3, int var4, int var5)
|
|
|
|
{
|
|
|
|
for (int var6 = 0; var6 < 64; ++var6)
|
|
|
|
{
|
|
|
|
int var7 = var3 + var2.nextInt(8) - var2.nextInt(8);
|
|
|
|
int var8 = var4 + var2.nextInt(4) - var2.nextInt(4);
|
|
|
|
int var9 = var5 + var2.nextInt(8) - var2.nextInt(8);
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
if (var1.isAirBlock(var7, var8, var9) && var1.getBlockId(var7, var8 - 1, var9) == Block.grass.blockID && Block.melon.canPlaceBlockAt(var1, var7, var8, var9))
|
|
|
|
{
|
|
|
|
var1.setBlock(var7, var8, var9, Block.melon.blockID);
|
|
|
|
}
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
return true;
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|