Fixed a crash with disabling river gen

This commit is contained in:
Adubbz 2016-01-19 12:56:55 +11:00
parent 601c509a68
commit 384abcec96

View file

@ -76,14 +76,18 @@ public class GenLayerRiverMixBOP extends BOPGenLayer
private boolean biomeSupportsRivers(int biomeId)
{
BiomeGenBase biome = BiomeGenBase.getBiome(biomeId);
if (biome != null && biome instanceof BOPBiome)
//Check if the biome id is valid
if (biomeId >= 0 && biomeId <= BiomeGenBase.getBiomeGenArray().length)
{
BOPBiome bopBiome = (BOPBiome)biome;
return bopBiome.canGenerateRivers;
BiomeGenBase biome = BiomeGenBase.getBiome(biomeId);
if (biome != null && biome instanceof BOPBiome)
{
BOPBiome bopBiome = (BOPBiome)biome;
return bopBiome.canGenerateRivers;
}
}
return true;
}
}