From 6f3410f5cdd7ae6f2e99c8847cb619ed767aa778 Mon Sep 17 00:00:00 2001 From: Corgi Taco <66983020+CorgiTaco@users.noreply.github.com> Date: Sat, 20 Mar 2021 17:04:25 -0700 Subject: [PATCH] -Modded End and Nether chunk generator compat in BOP Worldtype (#1825) --- .../common/world/BOPDimensionType.java | 22 +++---------------- .../resources/META-INF/accesstransformer.cfg | 4 ++++ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/main/java/biomesoplenty/common/world/BOPDimensionType.java b/src/main/java/biomesoplenty/common/world/BOPDimensionType.java index d81f5a7fb..e837123e7 100644 --- a/src/main/java/biomesoplenty/common/world/BOPDimensionType.java +++ b/src/main/java/biomesoplenty/common/world/BOPDimensionType.java @@ -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_); } - private static ChunkGenerator bopEndGenerator(Registry biomeRegistry, Registry dimensionSettingsRegistry, long seed) - { - return new NoiseChunkGenerator(new EndBiomeProvider(biomeRegistry, seed), seed, () -> dimensionSettingsRegistry.getOrThrow(DimensionSettings.END)); - } - private static ChunkGenerator bopNetherGenerator(Registry biomeRegistry, Registry dimensionSettingsRegistry, long seed) { - BiomeProvider biomeProvider; - - 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)); + return new NoiseChunkGenerator(new BOPNetherBiomeProvider(seed, biomeRegistry), seed, () -> dimensionSettingsRegistry.getOrThrow(DimensionSettings.NETHER)); } public static SimpleRegistry bopDimensions(Registry biomeRegistry, Registry dimensionSettingsRegistry, long seed) { SimpleRegistry 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.END, new Dimension(() -> DEFAULT_END, bopEndGenerator(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, DimensionType.defaultEndGenerator(biomeRegistry, dimensionSettingsRegistry, seed)), Lifecycle.stable()); return registry; } } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index ce0dd3a86..3769316e9 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -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 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 \ No newline at end of file