Search in sources :

Example 1 with HollowCylinderBrush

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

the class BrushCommands method cylinderBrush.

@Command(name = "cylinder", aliases = { "cyl", "c" }, desc = "Choose the cylinder brush")
@CommandPermissions("worldedit.brush.cylinder")
public void cylinderBrush(InjectedValueAccess context, @Arg(desc = "The pattern of blocks to set") Pattern pattern, @Arg(desc = "The radius of the cylinder", def = "2") Expression radius, @Arg(desc = "The height of the cylinder", def = "1") int height, // FAWE start - hcyl thickness
@Arg(desc = "The thickness of the cylinder. Requires -h switch be given. 0 creates a standard hollow cylinder.", def = "0") double thickness, // FAWE end
@Switch(name = 'h', desc = "Create hollow cylinders instead") boolean hollow) throws WorldEditException {
    worldEdit.checkMaxBrushRadius(radius);
    worldEdit.checkMaxBrushRadius(height);
    BrushSettings settings;
    if (hollow) {
        // FAWE start - hcyl thickness
        settings = set(context, new HollowCylinderBrush(height, thickness), "worldedit.brush.cylinder");
    // FAWE end
    } else {
        settings = set(context, new CylinderBrush(height), "worldedit.brush.cylinder");
    }
    settings.setSize(radius).setFill(pattern);
}
Also used : CylinderBrush(com.sk89q.worldedit.command.tool.brush.CylinderBrush) HollowCylinderBrush(com.sk89q.worldedit.command.tool.brush.HollowCylinderBrush) BrushSettings(com.fastasyncworldedit.core.command.tool.brush.BrushSettings) HollowCylinderBrush(com.sk89q.worldedit.command.tool.brush.HollowCylinderBrush) ScatterCommand(com.fastasyncworldedit.core.command.tool.brush.ScatterCommand) Command(org.enginehub.piston.annotation.Command) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Aggregations

BrushSettings (com.fastasyncworldedit.core.command.tool.brush.BrushSettings)1 ScatterCommand (com.fastasyncworldedit.core.command.tool.brush.ScatterCommand)1 CylinderBrush (com.sk89q.worldedit.command.tool.brush.CylinderBrush)1 HollowCylinderBrush (com.sk89q.worldedit.command.tool.brush.HollowCylinderBrush)1 CommandPermissions (com.sk89q.worldedit.command.util.CommandPermissions)1 Command (org.enginehub.piston.annotation.Command)1