Fixed world generator not saving generated values.
This commit is contained in:
parent
c5e3c08546
commit
d0facd268a
@ -51,24 +51,25 @@ public class IslandWorldGenerator {
|
||||
|
||||
//Sets the biome.
|
||||
Biome currentBiome = biomeGenerator.GenerateBiome(chunkX, chunkZ, localX, localZ);
|
||||
if (currentBiome == null) throw new IllegalStateException("Biome generated was null!");
|
||||
for (int y = 0; y < maxHeight; y++) {
|
||||
biomeGrid.setBiome(localX, y, localZ, currentBiome);
|
||||
}
|
||||
|
||||
//get height shader.
|
||||
int height;
|
||||
int height = 0;
|
||||
try {
|
||||
height = heightShader.getAltitude(worldX, worldZ, currentBiome);
|
||||
} catch (InvalidAlgorithmParameterException e) {
|
||||
e.printStackTrace();
|
||||
height = maxHeight;
|
||||
}
|
||||
|
||||
if (height == 0) throw new IllegalStateException("Height generated was null!");
|
||||
|
||||
//set general shape
|
||||
chunk.setRegion(localX, 0, localZ, localX, height, localZ, Material.STONE);
|
||||
chunk.setRegion(localX, 0, localZ, localX + 1, height, localZ + 1, Material.STONE);
|
||||
|
||||
//set bedrock last
|
||||
chunk.setRegion(localX, 0, localZ, localX, bedrockHeight, localZ, Material.BEDROCK);
|
||||
chunk.setRegion(localX, 0, localZ, localX + 1, bedrockHeight, localZ + 1, Material.BEDROCK);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user