Search in sources :

Example 1 with TropicraftChunkGenerator

use of net.tropicraft.core.common.dimension.chunk.TropicraftChunkGenerator in project Tropicraft by Tropicraft.

the class TropicraftDimension method createGenerator.

public static ChunkGenerator createGenerator(Registry<Biome> biomeRegistry, Registry<NoiseGeneratorSettings> dimensionSettingsRegistry, long seed) {
    Supplier<NoiseGeneratorSettings> dimensionSettings = () -> {
        // fallback to overworld so that we don't crash before our datapack is loaded (horrible workaround)
        NoiseGeneratorSettings settings = dimensionSettingsRegistry.get(DIMENSION_SETTINGS);
        return settings != null ? settings : dimensionSettingsRegistry.getOrThrow(NoiseGeneratorSettings.OVERWORLD);
    };
    TropicraftBiomeProvider biomeSource = new TropicraftBiomeProvider(seed, biomeRegistry);
    return new TropicraftChunkGenerator(biomeSource, seed, dimensionSettings);
}
Also used : TropicraftChunkGenerator(net.tropicraft.core.common.dimension.chunk.TropicraftChunkGenerator) TropicraftBiomeProvider(net.tropicraft.core.common.dimension.biome.TropicraftBiomeProvider) NoiseGeneratorSettings(net.minecraft.world.level.levelgen.NoiseGeneratorSettings)

Aggregations

NoiseGeneratorSettings (net.minecraft.world.level.levelgen.NoiseGeneratorSettings)1 TropicraftBiomeProvider (net.tropicraft.core.common.dimension.biome.TropicraftBiomeProvider)1 TropicraftChunkGenerator (net.tropicraft.core.common.dimension.chunk.TropicraftChunkGenerator)1