Java Code Examples for com.sk89q.worldedit.LocalSession#enableSuperPickAxe()

The following examples show how to use com.sk89q.worldedit.LocalSession#enableSuperPickAxe() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SuperPickaxeCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"area"},
        usage = "<radius>",
        desc = "Enable the area super pickaxe pickaxe mode",
        min = 1,
        max = 1
)
@CommandPermissions("worldedit.superpickaxe.area")
public void area(Player player, LocalSession session, CommandContext args) throws WorldEditException {

    LocalConfiguration config = we.getConfiguration();
    int range = args.getInteger(0);

    if (range > config.maxSuperPickaxeSize) {
        BBC.TOOL_RANGE_ERROR.send(player, config.maxSuperPickaxeSize);
        return;
    }

    session.setSuperPickaxe(new AreaPickaxe(range));
    session.enableSuperPickAxe();
    BBC.SUPERPICKAXE_AREA_ENABLED.send(player);
}
 
Example 2
Source File: SuperPickaxeCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 6 votes vote down vote up
@Command(
        aliases = {"recur", "recursive"},
        usage = "<radius>",
        desc = "Enable the recursive super pickaxe pickaxe mode",
        min = 1,
        max = 1
)
@CommandPermissions("worldedit.superpickaxe.recursive")
public void recursive(Player player, LocalSession session, CommandContext args) throws WorldEditException {

    LocalConfiguration config = we.getConfiguration();
    double range = args.getDouble(0);

    if (range > config.maxSuperPickaxeSize) {
        BBC.TOOL_RANGE_ERROR.send(player, config.maxSuperPickaxeSize);
        return;
    }

    session.setSuperPickaxe(new RecursivePickaxe(range));
    session.enableSuperPickAxe();
    BBC.SUPERPICKAXE_AREA_ENABLED.send(player);
}
 
Example 3
Source File: BrushOptionsCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Command(
        aliases = {"/", ","},
        usage = "[on|off]",
        desc = "Toggle the super pickaxe function",
        min = 0,
        max = 1
)
@CommandPermissions("worldedit.superpickaxe")
public void togglePickaxe(Player player, LocalSession session, CommandContext args) throws WorldEditException {
    String newState = args.getString(0, null);
    if (session.hasSuperPickAxe()) {
        if ("on".equals(newState)) {
            BBC.SUPERPICKAXE_ENABLED.send(player);
            return;
        }

        session.disableSuperPickAxe();
        BBC.SUPERPICKAXE_DISABLED.send(player);
    } else {
        if ("off".equals(newState)) {

            BBC.SUPERPICKAXE_DISABLED.send(player);
            return;
        }
        session.enableSuperPickAxe();
        BBC.SUPERPICKAXE_ENABLED.send(player);
    }
}
 
Example 4
Source File: SuperPickaxeCommands.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Command(
        aliases = {"single"},
        usage = "",
        desc = "Enable the single block super pickaxe mode",
        min = 0,
        max = 0
)
@CommandPermissions("worldedit.superpickaxe")
public void single(Player player, LocalSession session, CommandContext args) throws WorldEditException {

    session.setSuperPickaxe(new SinglePickaxe());
    session.enableSuperPickAxe();
    BBC.SUPERPICKAXE_AREA_ENABLED.send(player);
}