Added an option to disable bop nether generation

This commit is contained in:
Adubbz 2020-07-15 12:04:17 +10:00
parent 99eb540906
commit 6cfa2afe4b
3 changed files with 23 additions and 2 deletions

View file

@ -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<Biome> 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<Dimension> bopDimensions(long seed)

View file

@ -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;
}

View file

@ -50,6 +50,7 @@ public class ModConfig
public static final ForgeConfigSpec.EnumValue<BOPOverworldGenSettings.TemperatureVariationScheme> temperatureVariationScheme;
public static final ForgeConfigSpec.EnumValue<BOPOverworldGenSettings.RainfallVariationScheme> 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();