diff --git a/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java b/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java index 3851be516..bcddcc40d 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java @@ -341,15 +341,19 @@ public class ChunkProviderGenerateBOP implements IChunkProvider { float weight = radialFalloff5x5[i + 2 + (j + 2) * 5]; TerrainSettings biomeSettings = this.biomeTerrainSettings.get(biomes[localX + i + 2 + (localZ + j + 2) * 10]); - settings.avgHeight += weight * biomeSettings.avgHeight; - settings.variationAbove += weight * biomeSettings.variationAbove; - settings.variationBelow += weight * biomeSettings.variationBelow; - settings.minHeight += weight * biomeSettings.minHeight; - settings.maxHeight += weight * biomeSettings.maxHeight; - settings.sidewaysNoiseAmount += weight * biomeSettings.sidewaysNoiseAmount; - for (int k = 0; k < settings.octaveWeights.length; k++) + + if (biomeSettings != null) { - settings.octaveWeights[k] += weight * biomeSettings.octaveWeights[k]; + settings.avgHeight += weight * biomeSettings.avgHeight; + settings.variationAbove += weight * biomeSettings.variationAbove; + settings.variationBelow += weight * biomeSettings.variationBelow; + settings.minHeight += weight * biomeSettings.minHeight; + settings.maxHeight += weight * biomeSettings.maxHeight; + settings.sidewaysNoiseAmount += weight * biomeSettings.sidewaysNoiseAmount; + for (int k = 0; k < settings.octaveWeights.length; k++) + { + settings.octaveWeights[k] += weight * biomeSettings.octaveWeights[k]; + } } } } diff --git a/src/main/java/biomesoplenty/common/world/WorldChunkManagerBOP.java b/src/main/java/biomesoplenty/common/world/WorldChunkManagerBOP.java index e1315920c..a1e602b95 100644 --- a/src/main/java/biomesoplenty/common/world/WorldChunkManagerBOP.java +++ b/src/main/java/biomesoplenty/common/world/WorldChunkManagerBOP.java @@ -271,45 +271,4 @@ public class WorldChunkManagerBOP extends WorldChunkManager return new GenLayer[] {riverMixFinal, biomesFinal, riverMixFinal}; } - - @Override - public boolean areBiomesViable(int x, int z, int radius, List allowedBiomes) - { - IntCache.resetIntCache(); - int minX = x - (radius >> 2); - int minY = z - (radius >> 2); - int maxX = x + (radius >> 2); - int maxY = z + (radius >> 2); - - int areaWidth = maxX - minX + 1; //Find difference between the min and the max X. Add 1 as the result cannot be 0 - int areaHeight = maxY - minY + 1; //Find difference between the min and the max Y. Add 1 as the result cannot be 0 - int[] biomeIds = this.genBiomes.getInts(minX, minY, areaWidth, areaHeight); //Create an array of the biome ids within the desired area - - try - { - //Ensure entire area contains only desired biomes - for (int index = 0; index < areaWidth * areaHeight; ++index) - { - BiomeGenBase biomegenbase = BiomeGenBase.getBiome(biomeIds[index]); - - if (!allowedBiomes.contains(biomegenbase)) - { - return false; //Stop checking, we have found an undesirable biome - } - } - - return true; - } - catch (Throwable throwable) - { - CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); - CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer"); - crashreportcategory.addCrashSection("Layer", this.genBiomes.toString()); - crashreportcategory.addCrashSection("x", Integer.valueOf(x)); - crashreportcategory.addCrashSection("z", Integer.valueOf(z)); - crashreportcategory.addCrashSection("radius", Integer.valueOf(radius)); - crashreportcategory.addCrashSection("allowed", allowedBiomes); - throw new ReportedException(crashreport); - } - } }