diff --git a/src/main/java/biomesoplenty/common/world/BOPDimensionType.java b/src/main/java/biomesoplenty/common/world/BOPDimensionType.java index b063df584..68d3b1172 100644 --- a/src/main/java/biomesoplenty/common/world/BOPDimensionType.java +++ b/src/main/java/biomesoplenty/common/world/BOPDimensionType.java @@ -1,17 +1,24 @@ package biomesoplenty.common.world; +import biomesoplenty.init.ModConfig; +import com.google.common.collect.ImmutableList; +import com.mojang.datafixers.util.Pair; import com.mojang.serialization.Lifecycle; import net.minecraft.util.ResourceLocation; import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.SimpleRegistry; import net.minecraft.world.Dimension; import net.minecraft.world.DimensionType; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.Biomes; +import net.minecraft.world.biome.provider.BiomeProvider; import net.minecraft.world.biome.provider.EndBiomeProvider; import net.minecraft.world.biome.provider.NetherBiomeProvider; import net.minecraft.world.gen.ChunkGenerator; import net.minecraft.world.gen.DimensionSettings; import net.minecraft.world.gen.NoiseChunkGenerator; +import java.util.Optional; import java.util.OptionalLong; /*** @@ -32,7 +39,19 @@ public class BOPDimensionType extends DimensionType private static ChunkGenerator bopNetherGenerator(long seed) { - return new NoiseChunkGenerator(new BOPNetherBiomeProvider(seed), seed, DimensionSettings.Preset.NETHER.settings()); + BiomeProvider biomeProvider; + + if (ModConfig.GenerationConfig.useBopNether.get()) + { + biomeProvider = new BOPNetherBiomeProvider(seed); + } + else + { + ImmutableList netherBiomes = ImmutableList.of(Biomes.NETHER_WASTES, Biomes.SOUL_SAND_VALLEY, Biomes.CRIMSON_FOREST, Biomes.WARPED_FOREST, Biomes.BASALT_DELTAS); + biomeProvider = new NetherBiomeProvider(seed, netherBiomes.stream().flatMap((biome) -> biome.optimalParameters().map((parameter) -> Pair.of(parameter, biome))).collect(ImmutableList.toImmutableList()), Optional.of(NetherBiomeProvider.Preset.NETHER)); + } + + return new NoiseChunkGenerator(biomeProvider, seed, DimensionSettings.Preset.NETHER.settings()); } public static SimpleRegistry bopDimensions(long seed) diff --git a/src/main/java/biomesoplenty/common/world/BOPWorldTypeUtil.java b/src/main/java/biomesoplenty/common/world/BOPWorldTypeUtil.java index 846339cc2..5a82c9f2e 100644 --- a/src/main/java/biomesoplenty/common/world/BOPWorldTypeUtil.java +++ b/src/main/java/biomesoplenty/common/world/BOPWorldTypeUtil.java @@ -60,7 +60,7 @@ public class BOPWorldTypeUtil } // Ensure our nether and overworld biome providers are being used - if (!(overworld.generator().getBiomeSource() instanceof BOPBiomeProvider) || !(nether.generator().getBiomeSource() instanceof BOPNetherBiomeProvider)) + if (!(overworld.generator().getBiomeSource() instanceof BOPBiomeProvider) || !(nether.generator().getBiomeSource() instanceof BOPNetherBiomeProvider || nether.generator().getBiomeSource() instanceof NetherBiomeProvider)) { return false; } diff --git a/src/main/java/biomesoplenty/init/ModConfig.java b/src/main/java/biomesoplenty/init/ModConfig.java index 88b602813..910c5a3fa 100644 --- a/src/main/java/biomesoplenty/init/ModConfig.java +++ b/src/main/java/biomesoplenty/init/ModConfig.java @@ -50,6 +50,7 @@ public class ModConfig public static final ForgeConfigSpec.EnumValue temperatureVariationScheme; public static final ForgeConfigSpec.EnumValue rainfallVariationScheme; public static final ForgeConfigSpec.BooleanValue enhanceVanillaBiomes; + public static final ForgeConfigSpec.BooleanValue useBopNether; static { @@ -60,6 +61,7 @@ public class ModConfig temperatureVariationScheme = BUILDER.comment("Type of temperature zones to use during biome placement.").defineEnum("temperature_variation_scheme", BOPOverworldGenSettings.TemperatureVariationScheme.MEDIUM_ZONES); rainfallVariationScheme = BUILDER.comment("Type of rainfall zones to use during biome placement.").defineEnum("rainfall_variation_scheme", BOPOverworldGenSettings.RainfallVariationScheme.MEDIUM_ZONES); enhanceVanillaBiomes = BUILDER.comment("Enhance vanilla biomes by adding additional decoration.").define("enhance_vanilla_biomes", true); + useBopNether = BUILDER.comment("Enable nether generation from Biomes O' Plenty.").define("use_bop_nether", true); BUILDER.pop(); SPEC = BUILDER.build();