Height shader now takes random object in constructor.

Removed old height shader code having to do with this change.

Implmemented changes to chunk generator.
This commit is contained in:
Harrison Deng 2020-04-30 15:11:07 -05:00
parent 0eb2a13d14
commit 3e80d1e67d
2 changed files with 2 additions and 4 deletions

View File

@ -40,7 +40,7 @@ public class IslandWorldChunkGenerator extends ChunkGenerator implements Listene
this.currentWorld = world;
IslandWorldMapper mapper = new IslandWorldMapper(random, blockValueCache);
TemperatureMapGenerator temperatureMapGenerator = new TemperatureMapGenerator(world.getSeed());
WorldHeightShader heightShader = new WorldHeightShader(world.getSeed(), mapper, world.getSeaLevel(), world.getMaxHeight(), 3);
WorldHeightShader heightShader = new WorldHeightShader(random, mapper, world.getSeaLevel(), world.getMaxHeight(), 3);
BiomeGenerator biomeGenerator = new UniBiomeIslandGenerator();
int maxHeight = world.getMaxHeight();

View File

@ -8,7 +8,6 @@ import org.bukkit.util.noise.SimplexOctaveGenerator;
import ca.recrown.islandsurvivalcraft.world.IslandWorldMapper;
public class WorldHeightShader {
private final Random random;
private final SimplexOctaveGenerator noiseGenerator;
private final IslandWorldMapper islandLocator;
private final int seaLevel;
@ -16,8 +15,7 @@ public class WorldHeightShader {
private final int minimumHeight;
private final float probabilityOfAdditive = 0.75f;
public WorldHeightShader(long seed, IslandWorldMapper islandLocator, int seaLevel, int worldHeight, int minimumHeight) {
random = new Random(seed);
public WorldHeightShader(Random random, IslandWorldMapper islandLocator, int seaLevel, int worldHeight, int minimumHeight) {
noiseGenerator = new SimplexOctaveGenerator(random, 2);
noiseGenerator.setScale(0.075D);
this.islandLocator = islandLocator;