diff --git a/ClassicalSharp/Generator/Noise.cs b/ClassicalSharp/Generator/Noise.cs index bd5061fa5..602ede782 100644 --- a/ClassicalSharp/Generator/Noise.cs +++ b/ClassicalSharp/Generator/Noise.cs @@ -31,10 +31,10 @@ namespace ClassicalSharp.Generator { // and add blended results from 4 corners of rectangle. return Lerp( v, - Lerp( u, Grad( p[AA], x, y, 0 ), - Grad( p[BA], x - 1, y, 0 ) ), - Lerp( u, Grad( p[AB], x, y - 1, 0 ), - Grad( p[BB], x - 1, y - 1, 0 ) ) + Lerp( u, Grad( p[AA], x, y ), + Grad( p[BA], x - 1, y ) ), + Lerp( u, Grad( p[AB], x, y - 1 ), + Grad( p[BB], x - 1, y - 1 ) ) ); } @@ -46,11 +46,11 @@ namespace ClassicalSharp.Generator { return a + t * (b - a); } - static double Grad( int hash, double x, double y, double z ) { + static double Grad( int hash, double x, double y ) { // convert low 4 bits of hash code into 12 gradient directions. int h = hash & 15; double u = h < 8 ? x : y; - double v = h < 4 ? y : h == 12 || h == 14 ? x : z; + double v = h < 4 ? y : h == 12 || h == 14 ? x : 0; return ((h & 1) == 0 ? u : -u) + ((h & 2) == 0 ? v : -v); } diff --git a/ClassicalSharp/Generator/NotchyGenerator.cs b/ClassicalSharp/Generator/NotchyGenerator.cs index a1c1db88c..462e6aaf4 100644 --- a/ClassicalSharp/Generator/NotchyGenerator.cs +++ b/ClassicalSharp/Generator/NotchyGenerator.cs @@ -11,9 +11,22 @@ namespace ClassicalSharp.Generator { int width, height, length; int waterLevel; + byte[] blocks; + short[] heightmap; + public byte[] GenerateMap( int width, int height, int length ) { + this.width = width; + this.height = height; + this.length = length; + waterLevel = height / 2; + blocks = new byte[width * height * length]; + + CreateHeightmap(); + CreateStrata(); + return null; + } - short[] CreateHeightmap() { + void CreateHeightmap() { Noise n1 = new CombinedNoise( new OctaveNoise( 8 ), new OctaveNoise( 8 ) ); Noise n2 = new CombinedNoise( @@ -32,7 +45,25 @@ namespace ClassicalSharp.Generator { map[index++] = (short)(height + waterLevel); } } - return map; + heightmap = map; + } + + void CreateStrata() { + Noise n = new OctaveNoise( 8 ); + + int mapIndex = 0; + for( int z = 0; z < length; z++ ) { + for( int x = 0; x < width; x++ ) { + int dirtThickness = (int)(n.Compute( x, z ) / 24 - 4); + int dirtHeight = heightmap[mapIndex]; + int stoneHeight = dirtHeight + dirtThickness; + + for( int y = 0; y < height; y++ ) { + + } + mapIndex++; + } + } } } } \ No newline at end of file diff --git a/Launcher2/Utils/Client.cs b/Launcher2/Utils/Client.cs index f425c1bef..ce11b7603 100644 --- a/Launcher2/Utils/Client.cs +++ b/Launcher2/Utils/Client.cs @@ -8,7 +8,7 @@ namespace Launcher2 { public static class Client { public static bool Start( ClientStartData data, bool classicubeSkins, ref bool shouldExit ) { - string skinServer = classicubeSkins ? "http://www.classicube.net/static/skins/" : + string skinServer = classicubeSkins ? "http://static.classicube.net/skins/" : "http://s3.amazonaws.com/MinecraftSkins/"; string args = data.Username + " " + data.Mppass + " " + data.Ip + " " + data.Port + " " + skinServer;