mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Clamp acceptable density for //flora and //forest.
Fixes WORLDEDIT-3148.
This commit is contained in:
parent
e9ca618961
commit
85f014e256
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user