use of org.spongepowered.api.world.gen.populator.Vine in project SpongeCommon by SpongePowered.
the class MixinBiomeJungle method buildPopulators.
@Override
public void buildPopulators(World world, SpongeBiomeGenerationSettings gensettings) {
super.buildPopulators(world, gensettings);
BiomeDecorator theBiomeDecorator = this.decorator;
for (Iterator<Populator> it = gensettings.getPopulators().iterator(); it.hasNext(); ) {
Populator next = it.next();
if (next instanceof Shrub) {
Shrub s = (Shrub) next;
if (s.getTypes().size() == 1) {
TableEntry<ShrubType> entry = s.getTypes().getEntries().get(0);
if (entry instanceof WeightedObject && ((WeightedObject<ShrubType>) entry).get() == ShrubTypes.TALL_GRASS) {
it.remove();
}
}
}
}
Shrub grass = Shrub.builder().perChunk(theBiomeDecorator.grassPerChunk * 128).type(ShrubTypes.FERN, 1).type(ShrubTypes.TALL_GRASS, 3).build();
gensettings.getPopulators().add(grass);
Melon melon = Melon.builder().perChunk(64).build();
gensettings.getPopulators().add(melon);
Vine vine = Vine.builder().perChunk(50).build();
gensettings.getPopulators().add(vine);
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.getLargePopulatorObject().get(), 1);
forest.type(BiomeTreeTypes.JUNGLE_BUSH.getPopulatorObject(), 4.5);
if (!this.isEdge) {
forest.type(BiomeTreeTypes.JUNGLE.getLargePopulatorObject().get(), 1.2);
forest.type(BiomeTreeTypes.JUNGLE.getPopulatorObject(), 3);
} else {
forest.type(BiomeTreeTypes.JUNGLE.getPopulatorObject(), 4.5);
}
gensettings.getPopulators().add(0, forest.build());
}
use of org.spongepowered.api.world.gen.populator.Vine in project SpongeCommon by SpongePowered.
the class VineBuilder method build.
@Override
public Vine build() throws IllegalStateException {
Vine vine = (Vine) new WorldGenVines();
vine.setVinesPerChunk(this.count);
return vine;
}
Aggregations