use of org.spongepowered.common.world.gen.populators.MesaBiomeGenerationPopulator in project SpongeCommon by SpongePowered.
the class MixinBiomeMesa method buildPopulators.
@Override
public void buildPopulators(World world, SpongeBiomeGenerationSettings gensettings) {
gensettings.getGenerationPopulators().add(new MesaBiomeGenerationPopulator(this.brycePillars, this.hasForest));
super.buildPopulators(world, gensettings);
String s = world.getWorldInfo().getGeneratorOptions();
ChunkGeneratorSettings settings;
if (s != null) {
settings = ChunkGeneratorSettings.Factory.jsonToFactory(s).build();
} else {
settings = ChunkGeneratorSettings.Factory.jsonToFactory("").build();
}
// Extra gold is generated in mesa biomes
Ore gold = Ore.builder().ore((BlockState) Blocks.GOLD_ORE.getDefaultState()).size(settings.goldSize).perChunk(20).height(VariableAmount.baseWithRandomAddition(32, 80 - 32)).build();
gensettings.getPopulators().add(gold);
BiomeDecorator theBiomeDecorator = this.decorator;
gensettings.getGroundCoverLayers().clear();
gensettings.getPopulators().removeAll(gensettings.getPopulators(Forest.class));
Forest.Builder forest = Forest.builder();
forest.perChunk(VariableAmount.baseWithOptionalAddition(theBiomeDecorator.treesPerChunk, 1, 0.1));
forest.type(BiomeTreeTypes.OAK.getPopulatorObject(), 1);
gensettings.getPopulators().add(0, forest.build());
gensettings.getPopulators().removeAll(gensettings.getPopulators(Cactus.class));
Cactus cactus = Cactus.builder().cactiPerChunk(VariableAmount.baseWithOptionalAddition(0, VariableAmount.baseWithRandomAddition(1, VariableAmount.baseWithOptionalAddition(2, 3, 0.25)), 0.4)).build();
gensettings.getPopulators().add(cactus);
}
Aggregations