Search in sources :

Example 1 with SmoothBrush

use of com.sk89q.worldedit.command.tool.brush.SmoothBrush in project FastAsyncWorldEdit by IntellectualSites.

the class BrushCommands method smoothBrush.

@Command(name = "smooth", desc = "Choose the terrain softener brush", descFooter = "Example: '/brush smooth 2 4 grass_block,dirt,stone'")
@CommandPermissions("worldedit.brush.smooth")
public void smoothBrush(Player player, LocalSession session, // FAWE start - Expression > double
@Arg(desc = "The radius to sample for softening", def = "2") Expression radius, // FAWE end
@Arg(desc = "The number of iterations to perform", def = "4") int iterations, @Arg(desc = "The mask of blocks to use for the heightmap", def = "") Mask mask, InjectedValueAccess context) throws WorldEditException {
    worldEdit.checkMaxBrushRadius(radius);
    // FAWE start
    FaweLimit limit = Settings.settings().getLimit(player);
    iterations = Math.min(limit.MAX_ITERATIONS, iterations);
    // FAWE end
    set(context, new SmoothBrush(iterations, mask), "worldedit.brush.smooth").setSize(radius);
    player.print(Caption.of("worldedit.brush.smooth.equip", radius, iterations, Caption.of("worldedit.brush.smooth." + (mask == null ? "no" : "") + "filter")));
}
Also used : SnowSmoothBrush(com.sk89q.worldedit.command.tool.brush.SnowSmoothBrush) SmoothBrush(com.sk89q.worldedit.command.tool.brush.SmoothBrush) FaweLimit(com.fastasyncworldedit.core.limit.FaweLimit) ScatterCommand(com.fastasyncworldedit.core.command.tool.brush.ScatterCommand) Command(org.enginehub.piston.annotation.Command) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Aggregations

ScatterCommand (com.fastasyncworldedit.core.command.tool.brush.ScatterCommand)1 FaweLimit (com.fastasyncworldedit.core.limit.FaweLimit)1 SmoothBrush (com.sk89q.worldedit.command.tool.brush.SmoothBrush)1 SnowSmoothBrush (com.sk89q.worldedit.command.tool.brush.SnowSmoothBrush)1 CommandPermissions (com.sk89q.worldedit.command.util.CommandPermissions)1 Command (org.enginehub.piston.annotation.Command)1