Search in sources :

Example 1 with BCLibEndBiomeSource

use of ru.bclib.world.generator.BCLibEndBiomeSource in project BCLib by paulevsGitch.

the class DimensionTypeMixin method bclib_updateDimensions.

@Inject(method = "defaultDimensions(Lnet/minecraft/core/RegistryAccess;JZ)Lnet/minecraft/core/MappedRegistry;", locals = LocalCapture.CAPTURE_FAILHARD, at = @At("TAIL"))
private static void bclib_updateDimensions(RegistryAccess registryAccess, long seed, boolean bl, CallbackInfoReturnable<MappedRegistry<LevelStem>> info, MappedRegistry<LevelStem> mappedRegistry, Registry<DimensionType> registry, Registry<Biome> biomeRegistry, Registry<NoiseGeneratorSettings> noiseSettingsRegistry, Registry<NormalNoise.NoiseParameters> noiseParamRegistry) {
    int id = mappedRegistry.getId(mappedRegistry.get(LevelStem.NETHER));
    mappedRegistry.registerOrOverride(OptionalInt.of(id), LevelStem.NETHER, new LevelStem(() -> registry.getOrThrow(DimensionType.NETHER_LOCATION), new NoiseBasedChunkGenerator(noiseParamRegistry, new BCLibNetherBiomeSource(biomeRegistry, seed), seed, () -> noiseSettingsRegistry.getOrThrow(NoiseGeneratorSettings.NETHER))), Lifecycle.stable());
    id = mappedRegistry.getId(mappedRegistry.get(LevelStem.END));
    mappedRegistry.registerOrOverride(OptionalInt.of(id), LevelStem.END, new LevelStem(() -> registry.getOrThrow(DimensionType.END_LOCATION), new NoiseBasedChunkGenerator(noiseParamRegistry, new BCLibEndBiomeSource(biomeRegistry, seed), seed, () -> noiseSettingsRegistry.getOrThrow(NoiseGeneratorSettings.END))), Lifecycle.stable());
}
Also used : LevelStem(net.minecraft.world.level.dimension.LevelStem) BCLibEndBiomeSource(ru.bclib.world.generator.BCLibEndBiomeSource) BCLibNetherBiomeSource(ru.bclib.world.generator.BCLibNetherBiomeSource) NoiseBasedChunkGenerator(net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

LevelStem (net.minecraft.world.level.dimension.LevelStem)1 NoiseBasedChunkGenerator (net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1 BCLibEndBiomeSource (ru.bclib.world.generator.BCLibEndBiomeSource)1 BCLibNetherBiomeSource (ru.bclib.world.generator.BCLibNetherBiomeSource)1