use of net.minecraft.world.level.levelgen.NoiseGeneratorSettings in project MinecraftForge by MinecraftForge.
the class DimensionSettingsTest method createNoiseGenerationSettings.
/**
* Create a NoiseGeneratorSettings instance copying all but the structure settings from overworld.
*/
private static NoiseGeneratorSettings createNoiseGenerationSettings() {
NoiseGeneratorSettings overworld = BuiltinRegistries.NOISE_GENERATOR_SETTINGS.getOrThrow(NoiseGeneratorSettings.OVERWORLD);
// Make a new StructureSettings with no structures
StructureSettings structures = new StructureSettings(Optional.empty(), new HashMap<>());
// Build a new NoiseGeneratorSettings copying all the other options from 'overworld'
return new NoiseGeneratorSettings(structures, overworld.noiseSettings(), overworld.getDefaultBlock(), overworld.getDefaultFluid(), overworld.surfaceRule(), overworld.seaLevel(), overworld.disableMobGeneration(), overworld.isAquifersEnabled(), overworld.isNoiseCavesEnabled(), overworld.isOreVeinsEnabled(), overworld.isNoodleCavesEnabled(), overworld.useLegacyRandomSource());
}
use of net.minecraft.world.level.levelgen.NoiseGeneratorSettings in project MinecraftForge by MinecraftForge.
the class DimensionSettingsTest method registerSettings.
/**
* Demonstrates how a mod can register custom DimensionSettings which can be referenced from
* within a datapack dimension config whilst being discoverable for other mods to add to and
* remove structures etc from.
*/
private void registerSettings(FMLCommonSetupEvent event) {
event.enqueueWork(() -> {
LOGGER.info("Registering custom DimensionSettings for Dimension: {}", TEST_OVERWORLD);
NoiseGeneratorSettings noiseGenSettings = createNoiseGenerationSettings();
BuiltinRegistries.register(BuiltinRegistries.NOISE_GENERATOR_SETTINGS, TEST_OVERWORLD, noiseGenSettings);
});
}
use of net.minecraft.world.level.levelgen.NoiseGeneratorSettings 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);
}
Aggregations