Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public byte[][] generateBlockSections(World world, Random random, int ChunkX, int ChunkZ, BiomeGrid biomes){
- byte[][] blocks = new byte[world.getMaxHeight() / 16][];
- int x, y, z;
- Random rand = new Random(world.getSeed());
- SimplexOctaveGenerator octave = new SimplexOctaveGenerator(rand, 12);
- SimplexOctaveGenerator octave2 = new SimplexOctaveGenerator(rand, 8);
- octave.setScale(1/48.0);
- octave2.setScale(1/8.0);
- for(x=0; x < 16; x++){
- for(z=0; z<16; z++){
- biomes.setBiome(x, z, Biome.SKY);
- int real_x = x+ChunkX * 16;
- int real_z = z+ChunkZ*16;
- for(y=0; y<255; y++){
- double threshold = 0.8;
- double threshold2 = 0.91;
- //for some reason this breaks Multiverse2
- if(y < 96 || y > 224){
- threshold2 = .99999;
- threshold = 1;
- }
- double noise = octave.noise(real_x, y*2, real_z, 0.5, 0.5);
- double noise2 = octave2.noise(real_x, y/2, real_z, 0.5, 0.5);
- if(noise > threshold || noise - noise2 > threshold2*2){
- setBlock(x, y, z, blocks, Material.ENDER_STONE);
- setBlock(x, y+1, z, blocks, Material.DIRT);
- setBlock(x, y+2, z, blocks, Material.GRASS);
- }
- }
- }
- }
- return blocks;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement