mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-23 09:34:35 -05:00
Use same skin server as ClassiCube client.
This commit is contained in:
parent
36bd0dfea8
commit
dae105edbd
3 changed files with 40 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue