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
1 changed files with 10 additions and 6 deletions

View File

@ -75,6 +75,9 @@ public class GenLayerRiverMixBOP extends BOPGenLayer
} }
private boolean biomeSupportsRivers(int biomeId) private boolean biomeSupportsRivers(int biomeId)
{
//Check if the biome id is valid
if (biomeId >= 0 && biomeId <= BiomeGenBase.getBiomeGenArray().length)
{ {
BiomeGenBase biome = BiomeGenBase.getBiome(biomeId); BiomeGenBase biome = BiomeGenBase.getBiome(biomeId);
@ -83,6 +86,7 @@ public class GenLayerRiverMixBOP extends BOPGenLayer
BOPBiome bopBiome = (BOPBiome)biome; BOPBiome bopBiome = (BOPBiome)biome;
return bopBiome.canGenerateRivers; return bopBiome.canGenerateRivers;
} }
}
return true; return true;
} }