override for the nether biome generator that is used by BN when older worlds are loaded

This commit is contained in:
Frank 2021-12-03 00:31:53 +01:00
parent 39255e140f
commit c6dc52a60d
2 changed files with 15 additions and 3 deletions

View file

@ -33,6 +33,18 @@ public class BCLibNetherBiomeSource extends BiomeSource {
private final Registry<Biome> biomeRegistry;
private BiomeMap biomeMap;
private final long seed;
private static boolean forceLegacyGenerator = false;
/**
* When true, the older square generator is used for the nether.
*
* This override is used (for example) by BetterNether to force the legacy generation for worlds
* that were created before 1.18
* @param val wether or not you want to force the old generatore.
*/
public static void setForceLegacyGeneration(boolean val){
forceLegacyGenerator = val;
}
@Deprecated(forRemoval = true)
public static final List<Consumer<BCLibNetherBiomeSource>> onInit = new LinkedList<>();
@ -65,7 +77,7 @@ public class BCLibNetherBiomeSource extends BiomeSource {
BiomeAPI.NETHER_BIOME_PICKER.getBiomes().forEach(biome -> biome.updateActualBiomes(biomeRegistry));
BiomeAPI.NETHER_BIOME_PICKER.rebuild();
if (GeneratorOptions.useOldBiomeGenerator()) {
if (GeneratorOptions.useOldBiomeGenerator() || forceLegacyGenerator) {
this.biomeMap = new SquareBiomeMap(seed, GeneratorOptions.getBiomeSizeNether(), BiomeAPI.NETHER_BIOME_PICKER);
}
else {