Made GroundScatterFunction use a NoiseGenerator.

This commit is contained in:
sk89q
2014-03-01 16:52:36 -08:00
parent d2e93dfe23
commit c5fdfa7a0d
7 changed files with 191 additions and 85 deletions

View File

@ -2662,12 +2662,16 @@ public class EditSession {
throws WorldEditException {
ForestGenerator generator = new ForestGenerator(this, treeGenerator);
generator.setRange(lowerY, upperY);
generator.setDensity(density);
// And we want to scatter them
GroundScatterFunction scatter = new GroundScatterFunction(this, generator);
scatter.setDensity(density);
scatter.setRange(lowerY, upperY);
int affected = 0;
for (Vector2D pt : it) {
if (generator.apply(pt)) {
if (scatter.apply(pt)) {
affected++;
}
}