Search in sources :

Example 1 with OperationFactoryBrush

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

the class BrushCommands method setOperationBasedBrush.

// FAWE end
static void setOperationBasedBrush(Player player, LocalSession session, double radius, Contextual<? extends Operation> factory, RegionFactory shape, String permission) throws WorldEditException {
    WorldEdit.getInstance().checkMaxBrushRadius(radius);
    BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType());
    tool.setSize(radius);
    tool.setFill(null);
    tool.setBrush(new OperationFactoryBrush(factory, shape, session), permission);
    player.print(Caption.of("worldedit.brush.operation.equip", TextComponent.of(factory.toString())));
    ToolCommands.sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT);
}
Also used : BrushTool(com.sk89q.worldedit.command.tool.BrushTool) OperationFactoryBrush(com.sk89q.worldedit.command.tool.brush.OperationFactoryBrush)

Example 2 with OperationFactoryBrush

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

the class BrushCommands method setOperationBasedBrush.

// FAWE end
static void setOperationBasedBrush(Player player, LocalSession session, // FAWE start - Expression > double
Expression radius, // FAWE end
Contextual<? extends Operation> factory, RegionFactory shape, String permission) throws WorldEditException {
    WorldEdit.getInstance().checkMaxBrushRadius(radius);
    BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType());
    tool.setSize(radius);
    tool.setFill(null);
    tool.setBrush(new OperationFactoryBrush(factory, shape, session), permission);
    player.print(Caption.of("worldedit.brush.operation.equip", TextComponent.of(factory.toString())));
    ToolCommands.sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT);
}
Also used : BrushTool(com.sk89q.worldedit.command.tool.BrushTool) OperationFactoryBrush(com.sk89q.worldedit.command.tool.brush.OperationFactoryBrush)

Aggregations

BrushTool (com.sk89q.worldedit.command.tool.BrushTool)2 OperationFactoryBrush (com.sk89q.worldedit.command.tool.brush.OperationFactoryBrush)2