diff --git a/src/main/java/ca/recrown/islandsurvivalcraft/world/generation/IslandWorldGenerator.java b/src/main/java/ca/recrown/islandsurvivalcraft/world/generation/IslandWorldGenerator.java index 3869713..f4146ac 100644 --- a/src/main/java/ca/recrown/islandsurvivalcraft/world/generation/IslandWorldGenerator.java +++ b/src/main/java/ca/recrown/islandsurvivalcraft/world/generation/IslandWorldGenerator.java @@ -49,26 +49,27 @@ public class IslandWorldGenerator { // gets the bedrock. int bedrockHeight = bedrockGenerator.getBedrockHeight(worldX, worldZ); - // Sets the biome. + //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; + //get height shader. + 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); } } \ No newline at end of file