Search in sources :

Example 1 with WorldGenerator

use of org.spongepowered.api.world.gen.WorldGenerator in project SpongeAPI by SpongePowered.

the class VoidWorldGeneratorModifier method modifyWorldGenerator.

@Override
public void modifyWorldGenerator(WorldProperties world, DataContainer settings, WorldGenerator worldGenerator) {
    worldGenerator.getGenerationPopulators().clear();
    worldGenerator.getPopulators().clear();
    for (BiomeType biome : Sponge.getRegistry().getAllOf(BiomeType.class)) {
        BiomeGenerationSettings biomeSettings = worldGenerator.getBiomeSettings(biome);
        biomeSettings.getGenerationPopulators().clear();
        biomeSettings.getPopulators().clear();
        biomeSettings.getGroundCoverLayers().clear();
    }
    worldGenerator.setBaseGenerationPopulator((world1, buffer, biomes) -> {
    });
    worldGenerator.setBiomeGenerator(buffer -> buffer.getBiomeWorker().fill((x, y, z) -> BiomeTypes.VOID));
}
Also used : WorldGenerator(org.spongepowered.api.world.gen.WorldGenerator) World(org.spongepowered.api.world.World) WorldProperties(org.spongepowered.api.world.storage.WorldProperties) Sponge(org.spongepowered.api.Sponge) DataContainer(org.spongepowered.api.data.DataContainer) BiomeGenerationSettings(org.spongepowered.api.world.biome.BiomeGenerationSettings) BiomeType(org.spongepowered.api.world.biome.BiomeType) BiomeTypes(org.spongepowered.api.world.biome.BiomeTypes) WorldGeneratorModifier(org.spongepowered.api.world.gen.WorldGeneratorModifier) BiomeType(org.spongepowered.api.world.biome.BiomeType) BiomeGenerationSettings(org.spongepowered.api.world.biome.BiomeGenerationSettings)

Aggregations

Sponge (org.spongepowered.api.Sponge)1 DataContainer (org.spongepowered.api.data.DataContainer)1 World (org.spongepowered.api.world.World)1 BiomeGenerationSettings (org.spongepowered.api.world.biome.BiomeGenerationSettings)1 BiomeType (org.spongepowered.api.world.biome.BiomeType)1 BiomeTypes (org.spongepowered.api.world.biome.BiomeTypes)1 WorldGenerator (org.spongepowered.api.world.gen.WorldGenerator)1 WorldGeneratorModifier (org.spongepowered.api.world.gen.WorldGeneratorModifier)1 WorldProperties (org.spongepowered.api.world.storage.WorldProperties)1