package bleachcraft.worldGen; import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class WorldGenChlorineBlock implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) { switch(world.provider.getDimension()){ case 0: generateSurface(world, random, chunkX*16, chunkZ*16); break; } } private void generateSurface(World world, Random rand, int chunkX, int chunkZ) { for (int i = 0; i < 16; i++){ int randPosXX = chunkX + rand.nextInt(16); int randPosYY = rand.nextInt(48); int randPosZZ = chunkZ + rand.nextInt(16); BlockPos pos = new BlockPos(randPosXX,randPosYY,randPosZZ); IBlockState state = bleachcraft.fluids.ChlorineBlock.instance.getDefaultState(); new WorldGenMinable(state, 10)).generate(world, rand, pos); } } }