Fixed crashing when gravel beaches are disabled. Closes #1846, #1857, #1866

This commit is contained in:
Adubbz 2021-06-17 15:06:51 +10:00
parent df04ab8727
commit c49a82b9c1

View file

@ -92,9 +92,7 @@ public enum BOPShoreLayer implements ICastleTransformer
if (BiomeUtil.hasMetadata(biome))
{
BiomeMetadata meta = BiomeUtil.getMetadata(biome);
if (meta.getBeachBiome() == null) return biomeId;
else return BiomeUtil.getBiomeId(meta.getBeachBiome());
return getBiomeIdIfPresent(meta.getBeachBiome(), biomeId);
}
else
{
@ -122,7 +120,7 @@ public enum BOPShoreLayer implements ICastleTransformer
private static int getBiomeIdIfPresent(RegistryKey<Biome> biome, int fallbackId)
{
return BiomeUtil.exists(biome) ? BiomeUtil.getBiomeId(biome) : fallbackId;
return biome != null && BiomeUtil.exists(biome) ? BiomeUtil.getBiomeId(biome) : fallbackId;
}
private static boolean isJungleCompatible(int biomeId)