use of com.sk89q.worldedit.function.generator.GardenPatchGenerator in project FastAsyncWorldEdit by IntellectualSites.
the class EditSession method makePumpkinPatches.
// FAWE start - support density
public int makePumpkinPatches(BlockVector3 position, int apothem, double density) throws MaxChangedBlocksException {
// We want to generate pumpkins
GardenPatchGenerator generator = new GardenPatchGenerator(this);
generator.setPlant(GardenPatchGenerator.getPumpkinPattern());
// In a region of the given radius
FlatRegion region = new CuboidRegion(// Causes clamping of Y range
getWorld(), position.add(-apothem, -5, -apothem), position.add(apothem, 10, apothem));
GroundFunction ground = new GroundFunction(new ExistingBlockMask(this), generator);
LayerVisitor visitor = new LayerVisitor(region, minimumBlockY(region), maximumBlockY(region), ground, this);
visitor.setMask(new NoiseFilter2D(new RandomNoise(), density));
Operations.completeLegacy(visitor);
return this.changes = ground.getAffected();
}
Aggregations