Search in sources :

Example 1 with RecursivePickaxe

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

the class SuperPickaxeCommands method recursive.

@Command(name = "recursive", aliases = { "recur" }, desc = "Enable the recursive super pickaxe pickaxe mode")
@CommandPermissions("worldedit.superpickaxe.recursive")
public void recursive(Player player, LocalSession session, @Arg(desc = "The range of the recursive pickaxe") double range) throws WorldEditException {
    LocalConfiguration config = we.getConfiguration();
    if (range > config.maxSuperPickaxeSize) {
        player.print(Caption.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize)));
        return;
    }
    session.setSuperPickaxe(new RecursivePickaxe(range));
    session.enableSuperPickAxe();
    player.print(Caption.of("worldedit.tool.superpickaxe.mode.recursive"));
}
Also used : RecursivePickaxe(com.sk89q.worldedit.command.tool.RecursivePickaxe) LocalConfiguration(com.sk89q.worldedit.LocalConfiguration) Command(org.enginehub.piston.annotation.Command) CommandPermissions(com.sk89q.worldedit.command.util.CommandPermissions)

Aggregations

LocalConfiguration (com.sk89q.worldedit.LocalConfiguration)1 RecursivePickaxe (com.sk89q.worldedit.command.tool.RecursivePickaxe)1 CommandPermissions (com.sk89q.worldedit.command.util.CommandPermissions)1 Command (org.enginehub.piston.annotation.Command)1