package wsdec13.peter;
import java.util.Random;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenFlowers;
import net.minecraft.world.gen.feature.WorldGenMinable;
public class TomatoWorldGenerator implements IWorldGenerator {
private int tomatoId;
public TomatoWorldGenerator(int tomatoId) {
this.tomatoId = tomatoId;
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch(world.provider.dimensionId){
case -1:
generateNether(world, random, chunkX * 16, chunkZ * 16);
break;
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
break;
case 1:
generateEnd(world, random, chunkX * 16, chunkZ * 16);
break;
}
}
private void generateEnd(World world, Random rand, int chunkX, int chunkZ) {
}
private void generateSurface(World world, Random rand, int chunkX, int chunkZ) {
for(int k = 0; k < 50; k++){
int firstBlockXCoord = chunkX + rand.nextInt(16) + 8;
int firstBlockYCoord = rand.nextInt(64);
int firstBlockZCoord = chunkZ + rand.nextInt(16) + 8;
(new WorldGenFlowers(tomatoId)).generate(world, rand, firstBlockXCoord, firstBlockYCoord, firstBlockZCoord);
}
}
private void generateNether(World world, Random rand, int chunkX, int chunkZ) {
}
}