mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Fixes and changes to forest/forestgen.
* Sync up implementations of the two commands. * Fix generating trees in spots with replaceable blocks. * Make message when you mistype tree-type arg more correct. Fixes WORLDEDIT-3869.
This commit is contained in:
@ -197,7 +197,8 @@ public class GenerationCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.generation.forest")
|
||||
@Logging(POSITION)
|
||||
public void forestGen(Player player, LocalSession session, EditSession editSession, @Optional("10") int size, @Optional("tree") TreeType type, @Optional("5") double density) throws WorldEditException {
|
||||
public void forestGen(Player player, LocalSession session, EditSession editSession, @Optional("10") int size,
|
||||
@Optional("tree") TreeType type, @Optional("5") @Range(min = 0, max = 100) double density) throws WorldEditException {
|
||||
density = density / 100;
|
||||
int affected = editSession.makeForest(session.getPlacementPosition(player), size, density, type);
|
||||
player.print(affected + " trees created.");
|
||||
|
@ -445,14 +445,8 @@ public class RegionCommands {
|
||||
@Logging(REGION)
|
||||
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;
|
||||
ForestGenerator generator = new ForestGenerator(editSession, type);
|
||||
GroundFunction ground = new GroundFunction(new ExistingBlockMask(editSession), generator);
|
||||
LayerVisitor visitor = new LayerVisitor(asFlatRegion(region), minimumBlockY(region), maximumBlockY(region), ground);
|
||||
visitor.setMask(new NoiseFilter2D(new RandomNoise(), density));
|
||||
Operations.completeLegacy(visitor);
|
||||
|
||||
player.print(ground.getAffected() + " trees created.");
|
||||
int affected = editSession.makeForest(region, density / 100, type);
|
||||
player.print(affected + " trees created.");
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
Reference in New Issue
Block a user