Clamp acceptable density for //flora and //forest.

Fixes WORLDEDIT-3148.
Dieser Commit ist enthalten in:
sk89q 2014-07-06 17:34:08 -07:00
Ursprung e9ca618961
Commit 85f014e256

Datei anzeigen

@ -449,7 +449,8 @@ public class RegionCommands {
) )
@CommandPermissions("worldedit.region.forest") @CommandPermissions("worldedit.region.forest")
@Logging(REGION) @Logging(REGION)
public void forest(Player player, EditSession editSession, @Selection Region region, @Optional("tree") TreeType type, @Optional("5") double density) throws WorldEditException { public void forest(Player player, EditSession editSession, @Selection Region region, @Optional("tree") TreeType type,
@Optional("5") @Range(min = 0, max = 100) double density) throws WorldEditException {
density = density / 100; density = density / 100;
ForestGenerator generator = new ForestGenerator(editSession, new TreeGenerator(type)); ForestGenerator generator = new ForestGenerator(editSession, new TreeGenerator(type));
GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator); GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator);
@ -469,7 +470,7 @@ public class RegionCommands {
) )
@CommandPermissions("worldedit.region.flora") @CommandPermissions("worldedit.region.flora")
@Logging(REGION) @Logging(REGION)
public void flora(Player player, EditSession editSession, @Selection Region region, @Optional("10") double density) throws WorldEditException { public void flora(Player player, EditSession editSession, @Selection Region region, @Optional("10") @Range(min = 0, max = 100) double density) throws WorldEditException {
density = density / 100; density = density / 100;
FloraGenerator generator = new FloraGenerator(editSession); FloraGenerator generator = new FloraGenerator(editSession);
GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator); GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator);