package net.tylermurphy.Minecraft.Gen; import net.tylermurphy.Minecraft.Chunk.Chunk; import net.tylermurphy.Minecraft.Chunk.PerlinNoise; import net.tylermurphy.Minecraft.Scene.World; public class WorldGenerator { private static int OCTAVES = 2; private static int AMPLITUDE = 10; private static int ROUGHNESS = 3; public static int generateHeight(int x, int z) { float total = 0; float d = (float) Math.pow(2, OCTAVES-1); for(int i=0;i2 && top > 90) { c.cubes[x][top+1][z] = 15; c.cubes[x][top+2][z] = 15; c.cubes[x][top+3][z] = 15; } } else { if(n1*n2/n4*n3>2 && top > 90) { if(x < 1 || x > 14 || z < 1 || z > 14) continue; c.cubes[x][top+1][z] = 10; c.cubes[x][top+2][z] = 10; c.cubes[x][top+3][z] = 10; c.cubes[x-1][top+3][z] = 12; c.cubes[x-1][top+3][z+1] = 12; c.cubes[x][top+3][z+1] = 12; c.cubes[x+1][top+3][z+1] = 12; c.cubes[x+1][top+3][z] = 12; c.cubes[x+1][top+3][z-1] = 12; c.cubes[x][top+3][z-1] = 12; c.cubes[x-1][top+3][z-1] = 12; c.cubes[x+1][top+4][z] = 12; c.cubes[x-1][top+4][z] = 12; c.cubes[x][top+4][z+1] = 12; c.cubes[x][top+4][z-1] = 12; c.cubes[x][top+4][z] = 12; } } } } } public static void generate(Chunk c) { generateLandscape(c); generateNature(c); } }