Biome generator change in way of caching island info.

Biome cache now stores a 4 biome values: current, main, shore, and shallow.
This commit is contained in:
2020-04-28 23:14:37 -05:00
parent 9c8dd377dd
commit 8595ab0c4e
4 changed files with 50 additions and 36 deletions

View File

@@ -24,7 +24,7 @@ public class UniBiomeIslandGeneratorTest {
private final int SEED = 249398015;
private final DummyWorld dummyWorld = new DummyWorld();
private final Cache<Point2, Double> blockValueCache = new Cache<>(102400);
private final Cache<Point2, Biome> biomeCache = new Cache<>(102400);
private final Cache<Point2, Biome[]> biomeCache = new Cache<>(102400);
private final Cache<Point2, Boolean> chunkExistenceCache = new Cache<>(16384);
private final Random rand = new Random(SEED);
@@ -68,13 +68,13 @@ public class UniBiomeIslandGeneratorTest {
@Test
public void testBiomeGenerationMultithread1608Chunks() {
int chunksToDo = 268;
Runnable g1 = new BiomeGenTask(chunksToDo, 0);
Runnable g2 = new BiomeGenTask(chunksToDo, 1);
Runnable g3 = new BiomeGenTask(chunksToDo, 2);
Runnable g4 = new BiomeGenTask(chunksToDo, 3);
Runnable g5 = new BiomeGenTask(chunksToDo, 4);
Runnable g6 = new BiomeGenTask(chunksToDo, 5);
int chunksToDoEach = 268;
Runnable g1 = new BiomeGenTask(chunksToDoEach, 0);
Runnable g2 = new BiomeGenTask(chunksToDoEach, 1);
Runnable g3 = new BiomeGenTask(chunksToDoEach, 2);
Runnable g4 = new BiomeGenTask(chunksToDoEach, 3);
Runnable g5 = new BiomeGenTask(chunksToDoEach, 4);
Runnable g6 = new BiomeGenTask(chunksToDoEach, 5);
ExecutorService ex = Executors.newFixedThreadPool(6);
ex.execute(g1);