Added flag to //smooth to only use "natural" blocks

This commit is contained in:
zml2008
2011-08-17 00:33:46 -07:00
parent c99d64cfa0
commit 2b94ddf7ed
6 changed files with 47 additions and 31 deletions

View File

@ -186,6 +186,7 @@ public class RegionCommands {
@Command(
aliases = {"/smooth"},
usage = "[iterations]",
flags = "n",
desc = "Smooth the elevation in the selection",
min = 0,
max = 1
@ -201,7 +202,7 @@ public class RegionCommands {
iterations = args.getInteger(0);
}
HeightMap heightMap = new HeightMap(editSession, session.getSelection(player.getWorld()));
HeightMap heightMap = new HeightMap(editSession, session.getSelection(player.getWorld()), args.hasFlag('n'));
HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0));
int affected = heightMap.applyFilter(filter, iterations);
player.print("Terrain's height map smoothed. " + affected + " block(s) changed.");