Fixed caves crash with non-be biome source (issue #148)

This commit is contained in:
paulevsGitch 2021-04-29 01:08:57 +03:00
parent 16b02e15bf
commit 9999abf945
3 changed files with 21 additions and 7 deletions

View file

@ -117,7 +117,8 @@ public abstract class EndCaveFeature extends DefaultFeature {
private void setBiome(WorldGenLevel world, BlockPos pos, EndCaveBiome biome) {
IBiomeArray array = (IBiomeArray) world.getChunk(pos).getBiomes();
if (array != null) {
array.be_setBiome(biome.getActualBiome(), pos);
Biome bio = EndBiomes.getActualBiome(biome);
array.be_setBiome(bio, pos);
}
}

View file

@ -89,12 +89,13 @@ public class BetterEndBiomeSource extends BiomeSource {
mapVoid.clearCache();
}
EndBiome endBiome = null;
if (GeneratorOptions.useNewGenerator()) {
if (TerrainGenerator.isLand(biomeX, biomeZ)) {
return mapLand.getBiome(biomeX << 2, biomeZ << 2).getActualBiome();
endBiome = mapLand.getBiome(biomeX << 2, biomeZ << 2);
}
else {
return mapVoid.getBiome(biomeX << 2, biomeZ << 2).getActualBiome();
endBiome = mapVoid.getBiome(biomeX << 2, biomeZ << 2);
}
}
else {
@ -104,9 +105,10 @@ public class BetterEndBiomeSource extends BiomeSource {
return barrens;
}
EndBiome endBiome = height < -10F ? mapVoid.getBiome(biomeX << 2, biomeZ << 2) : mapLand.getBiome(biomeX << 2, biomeZ << 2);
return endBiome.getActualBiome();
endBiome = height < -10F ? mapVoid.getBiome(biomeX << 2, biomeZ << 2) : mapLand.getBiome(biomeX << 2, biomeZ << 2);
}
return EndBiomes.getActualBiome(endBiome);
}
public Biome getLandBiome(int biomeX, int biomeY, int biomeZ) {
@ -124,7 +126,7 @@ public class BetterEndBiomeSource extends BiomeSource {
return this.centerBiome;
}
}
return mapLand.getBiome(biomeX << 2, biomeZ << 2).getActualBiome();
return EndBiomes.getActualBiome(mapLand.getBiome(biomeX << 2, biomeZ << 2));
}
@Override