Biome selector no longer requires random parameter.

Implemented new biome selector changes.
This commit is contained in:
Harrison Deng 2020-04-29 15:03:35 -05:00
parent c2fb0ffea8
commit 5b1bb4288d
3 changed files with 6 additions and 4 deletions

View File

@ -32,6 +32,10 @@ public class BiomeSelector {
temperaturePartitionedOceanBiomes.put(0.5f, new ArrayList<>()); temperaturePartitionedOceanBiomes.put(0.5f, new ArrayList<>());
} }
public BiomeSelector() {
this(new Random());
}
public void initialize() { public void initialize() {
if (initialized) throw new IllegalStateException("Biome selector is already initialized."); if (initialized) throw new IllegalStateException("Biome selector is already initialized.");

View File

@ -2,8 +2,6 @@ package ca.recrown.islandsurvivalcraft.world;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Random;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
@ -18,7 +16,7 @@ public class BiomeSelectorTest {
@BeforeAll @BeforeAll
public void setUp() { public void setUp() {
biomeSelector = new BiomeSelector(new Random()); biomeSelector = new BiomeSelector();
biomeSelector.initialize(); biomeSelector.initialize();
} }

View File

@ -50,7 +50,7 @@ public class UniBiomeIslandGeneratorTest {
public void generateBiome(int chunkX, int chunkZ) { public void generateBiome(int chunkX, int chunkZ) {
IslandWorldMapper mapper = new IslandWorldMapper(rand, blockValueCache); IslandWorldMapper mapper = new IslandWorldMapper(rand, blockValueCache);
TemperatureMapGenerator temperatureMapGenerator = new TemperatureMapGenerator(SEED); TemperatureMapGenerator temperatureMapGenerator = new TemperatureMapGenerator(SEED);
BiomeSelector biomeSelector = new BiomeSelector(rand); BiomeSelector biomeSelector = new BiomeSelector();
biomeSelector.initialize(); biomeSelector.initialize();
BiomeGenerator biomeGenerator = new UniBiomeIslandGenerator(); BiomeGenerator biomeGenerator = new UniBiomeIslandGenerator();