Search in sources :

Example 1 with WorldGenDoublePlant

use of net.minecraft.world.gen.feature.WorldGenDoublePlant in project SpongeCommon by SpongePowered.

the class DoublePlantBuilder method build.

@Override
public DoublePlant build() throws IllegalStateException {
    if (this.types.isEmpty()) {
        throw new IllegalStateException("Builder is missing required weighted plant types.");
    }
    WorldGenDoublePlant wgen = new WorldGenDoublePlant();
    // Set a default just in case the weighted table is ever empty
    wgen.setPlantType(EnumPlantType.GRASS);
    DoublePlant populator = (DoublePlant) wgen;
    populator.getPossibleTypes().addAll(this.types);
    populator.setPlantsPerChunk(this.count);
    populator.setSupplierOverride(this.override);
    return populator;
}
Also used : WorldGenDoublePlant(net.minecraft.world.gen.feature.WorldGenDoublePlant) WorldGenDoublePlant(net.minecraft.world.gen.feature.WorldGenDoublePlant) DoublePlant(org.spongepowered.api.world.gen.populator.DoublePlant)

Aggregations

WorldGenDoublePlant (net.minecraft.world.gen.feature.WorldGenDoublePlant)1 DoublePlant (org.spongepowered.api.world.gen.populator.DoublePlant)1