voxelImprovements #5
@ -1,6 +1,5 @@
|
|||||||
package electrosphere.server.terrain.generation;
|
package electrosphere.server.terrain.generation;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -72,25 +71,6 @@ public class TestGenerationChunkGenerator implements ChunkGenerator {
|
|||||||
int[][][] values = new int[ServerTerrainChunk.CHUNK_DIMENSION][ServerTerrainChunk.CHUNK_DIMENSION][ServerTerrainChunk.CHUNK_DIMENSION];
|
int[][][] values = new int[ServerTerrainChunk.CHUNK_DIMENSION][ServerTerrainChunk.CHUNK_DIMENSION][ServerTerrainChunk.CHUNK_DIMENSION];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(worldX == 0 || worldZ == 0){
|
|
||||||
//generate flat ground for the player to spawn on
|
|
||||||
for(int x = 0; x < ServerTerrainChunk.CHUNK_DIMENSION; x++){
|
|
||||||
for(int y = 0; y < ServerTerrainChunk.CHUNK_DIMENSION; y++){
|
|
||||||
Arrays.fill(weights[x][y],-1f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(worldY == 0){
|
|
||||||
for(int x = 0; x < ServerTerrainChunk.CHUNK_DIMENSION; x++){
|
|
||||||
for(int z = 0; z < ServerTerrainChunk.CHUNK_DIMENSION; z++){
|
|
||||||
values[x][0][z] = 1;
|
|
||||||
weights[x][0][z] = 0.1f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
//actual generation algo
|
//actual generation algo
|
||||||
|
|
||||||
//biome of the current chunk
|
//biome of the current chunk
|
||||||
@ -138,7 +118,6 @@ public class TestGenerationChunkGenerator implements ChunkGenerator {
|
|||||||
}
|
}
|
||||||
Globals.profiler.endCpuSample();
|
Globals.profiler.endCpuSample();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch(Exception ex){
|
} catch(Exception ex){
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,7 +98,7 @@ public class ChunkGenerationThread implements Runnable {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
try {
|
try {
|
||||||
while(chunk == null && i < MAX_TIME_TO_WAIT && Globals.threadManager.shouldKeepRunning()){
|
while(chunk == null && i < MAX_TIME_TO_WAIT && Globals.threadManager.shouldKeepRunning()){
|
||||||
if(chunkCache.containsChunk(worldX,worldY,worldZ,stride)){
|
if(chunkCache.containsChunk(worldX, worldY, worldZ, stride)){
|
||||||
chunk = chunkCache.get(worldX, worldY, worldZ, stride);
|
chunk = chunkCache.get(worldX, worldY, worldZ, stride);
|
||||||
} else {
|
} else {
|
||||||
//pull from disk if it exists
|
//pull from disk if it exists
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user