-Modded End and Nether chunk generator compat in BOP Worldtype (#1825)

This commit is contained in:
Corgi Taco 2021-03-20 17:04:25 -07:00 committed by GitHub
parent ecec6bb865
commit 6f3410f5cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 19 deletions

View file

@ -35,32 +35,16 @@ public class BOPDimensionType extends DimensionType
super(p_i241972_1_, p_i241972_2_, p_i241972_3_, p_i241972_4_, p_i241972_5_, p_i241972_6_, p_i241972_8_, p_i241972_9_, p_i241972_10_, p_i241972_11_, p_i241972_12_, p_i241972_13_, p_i241972_14_, p_i241972_15_); super(p_i241972_1_, p_i241972_2_, p_i241972_3_, p_i241972_4_, p_i241972_5_, p_i241972_6_, p_i241972_8_, p_i241972_9_, p_i241972_10_, p_i241972_11_, p_i241972_12_, p_i241972_13_, p_i241972_14_, p_i241972_15_);
} }
private static ChunkGenerator bopEndGenerator(Registry<Biome> biomeRegistry, Registry<DimensionSettings> dimensionSettingsRegistry, long seed)
{
return new NoiseChunkGenerator(new EndBiomeProvider(biomeRegistry, seed), seed, () -> dimensionSettingsRegistry.getOrThrow(DimensionSettings.END));
}
private static ChunkGenerator bopNetherGenerator(Registry<Biome> biomeRegistry, Registry<DimensionSettings> dimensionSettingsRegistry, long seed) private static ChunkGenerator bopNetherGenerator(Registry<Biome> biomeRegistry, Registry<DimensionSettings> dimensionSettingsRegistry, long seed)
{ {
BiomeProvider biomeProvider; return new NoiseChunkGenerator(new BOPNetherBiomeProvider(seed, biomeRegistry), seed, () -> dimensionSettingsRegistry.getOrThrow(DimensionSettings.NETHER));
if (ModConfig.GenerationConfig.useBopNether.get())
{
biomeProvider = new BOPNetherBiomeProvider(seed, biomeRegistry);
}
else
{
biomeProvider = NetherBiomeProvider.Preset.NETHER.biomeSource(biomeRegistry, seed);
}
return new NoiseChunkGenerator(biomeProvider, seed, () -> dimensionSettingsRegistry.getOrThrow(DimensionSettings.NETHER));
} }
public static SimpleRegistry<Dimension> bopDimensions(Registry<Biome> biomeRegistry, Registry<DimensionSettings> dimensionSettingsRegistry, long seed) public static SimpleRegistry<Dimension> bopDimensions(Registry<Biome> biomeRegistry, Registry<DimensionSettings> dimensionSettingsRegistry, long seed)
{ {
SimpleRegistry<Dimension> registry = new SimpleRegistry<>(Registry.LEVEL_STEM_REGISTRY, Lifecycle.experimental()); SimpleRegistry<Dimension> registry = new SimpleRegistry<>(Registry.LEVEL_STEM_REGISTRY, Lifecycle.experimental());
registry.register(Dimension.NETHER, new Dimension(() -> DEFAULT_NETHER, bopNetherGenerator(biomeRegistry, dimensionSettingsRegistry, seed)), Lifecycle.stable()); registry.register(Dimension.NETHER, new Dimension(() -> DEFAULT_NETHER, ModConfig.GenerationConfig.useBopNether.get() ? bopNetherGenerator(biomeRegistry, dimensionSettingsRegistry, seed) : DimensionType.defaultNetherGenerator(biomeRegistry, dimensionSettingsRegistry, seed)), Lifecycle.stable());
registry.register(Dimension.END, new Dimension(() -> DEFAULT_END, bopEndGenerator(biomeRegistry, dimensionSettingsRegistry, seed)), Lifecycle.stable()); registry.register(Dimension.END, new Dimension(() -> DEFAULT_END, DimensionType.defaultEndGenerator(biomeRegistry, dimensionSettingsRegistry, seed)), Lifecycle.stable());
return registry; return registry;
} }
} }

View file

@ -39,3 +39,7 @@ public-f net.minecraft.item.ShovelItem field_195955_e # FLATTENABLES
protected net.minecraft.entity.item.BoatEntity func_184447_s()V #tickLerp protected net.minecraft.entity.item.BoatEntity func_184447_s()V #tickLerp
public net.minecraft.world.gen.feature.WorldDecoratingHelper * public net.minecraft.world.gen.feature.WorldDecoratingHelper *
#Directly reference the vanilla default nether and end generators to capture mixins from other mods
public net.minecraft.world.DimensionType func_242717_a(Lnet/minecraft/util/registry/Registry;Lnet/minecraft/util/registry/Registry;J)Lnet/minecraft/world/gen/ChunkGenerator; # getEndChunkGenerator
public net.minecraft.world.DimensionType func_242720_b(Lnet/minecraft/util/registry/Registry;Lnet/minecraft/util/registry/Registry;J)Lnet/minecraft/world/gen/ChunkGenerator; # getNetherChunkGenerator