use of org.spongepowered.common.world.gen.populators.RoofedForestPopulator in project SpongeCommon by SpongePowered.
the class MixinBiomeForest method buildPopulators.
@Override
public void buildPopulators(World world, SpongeBiomeGenerationSettings gensettings) {
BiomeDecorator theBiomeDecorator = this.decorator;
int base = -3;
if (this.type == BiomeForest.Type.FLOWER) {
base = -1;
}
DoublePlant plant = DoublePlant.builder().perChunk(VariableAmount.baseWithRandomAddition(base * 5, 5 * 5)).type(DoublePlantTypes.SYRINGA, 1).type(DoublePlantTypes.ROSE, 1).type(DoublePlantTypes.PAEONIA, 1).build();
gensettings.getPopulators().add(plant);
super.buildPopulators(world, gensettings);
gensettings.getPopulators().removeAll(gensettings.getPopulators(Forest.class));
if (this.type == BiomeForest.Type.ROOFED) {
RoofedForestPopulator forest = new RoofedForestPopulator();
gensettings.getPopulators().add(0, forest);
} else {
Forest.Builder forest = Forest.builder();
forest.perChunk(VariableAmount.baseWithOptionalAddition(theBiomeDecorator.treesPerChunk, 1, 0.1));
if (this.type == BiomeForest.Type.BIRCH) {
forest.type(BiomeTreeTypes.BIRCH.getPopulatorObject(), 1);
} else {
forest.type(BiomeTreeTypes.OAK.getPopulatorObject(), 4);
forest.type(BiomeTreeTypes.BIRCH.getPopulatorObject(), 1);
}
gensettings.getPopulators().add(0, forest.build());
}
if (this.type == BiomeForest.Type.FLOWER) {
gensettings.getPopulators().removeAll(gensettings.getPopulators(Flower.class));
Flower flower = Flower.builder().perChunk(theBiomeDecorator.flowersPerChunk * 64).supplier(new FlowerForestSupplier()).build();
gensettings.getPopulators().add(flower);
}
}
Aggregations