Package com.sk89q.worldedit.command.tool

Examples of com.sk89q.worldedit.command.tool.Tool


                        event.setCancelled(superPickaxe.actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location));
                        return;
                    }
                }

                Tool tool = session.getTool(player.getItemInHand());
                if (tool != null && tool instanceof DoubleActionBlockTool) {
                    if (tool.canUse(player)) {
                        ((DoubleActionBlockTool) tool).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location);
                        event.setCancelled(true);
                    }
                }

            } else if (event.getType() == Interaction.OPEN) {
                if (player.getItemInHand() == getConfiguration().wandItem) {
                    if (!session.isToolControlEnabled()) {
                        return;
                    }

                    if (!actor.hasPermission("worldedit.selection.pos")) {
                        return;
                    }

                    RegionSelector selector = session.getRegionSelector(player.getWorld());
                    if (selector.selectSecondary(vector, ActorSelectorLimits.forActor(player))) {
                        selector.explainSecondarySelection(actor, session, vector);
                    }

                    event.setCancelled(true);
                    return;
                }

                Tool tool = session.getTool(player.getItemInHand());
                if (tool != null && tool instanceof BlockTool) {
                    if (tool.canUse(player)) {
                        ((BlockTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session, location);
                        event.setCancelled(true);
                    }
                }
            }
View Full Code Here


                    return;
                }

                LocalSession session = worldEdit.getSessionManager().get(player);

                Tool tool = session.getTool(player.getItemInHand());
                if (tool != null && tool instanceof DoubleActionTraceTool) {
                    if (tool.canUse(player)) {
                        ((DoubleActionTraceTool) tool).actSecondary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session);
                        event.setCancelled(true);
                        return;
                    }
                }

                break;
            }

            case SECONDARY: {
                if (player.getItemInHand() == getConfiguration().navigationWand) {
                    if (getConfiguration().navigationWandMaxDistance <= 0) {
                        return;
                    }

                    if (!player.hasPermission("worldedit.navigation.thru.tool")) {
                        return;
                    }

                    if (!player.passThroughForwardWall(40)) {
                        player.printError("Nothing to pass through!");
                    }

                    event.setCancelled(true);
                    return;
                }

                LocalSession session = worldEdit.getSessionManager().get(player);

                Tool tool = session.getTool(player.getItemInHand());
                if (tool != null && tool instanceof TraceTool) {
                    if (tool.canUse(player)) {
                        ((TraceTool) tool).actPrimary(queryCapability(Capability.WORLD_EDITING), getConfiguration(), player, session);
                        event.setCancelled(true);
                        return;
                    }
                }
View Full Code Here

     * @return the tool, or {@code null}
     * @throws InvalidToolBindException if the item can't be bound to that item
     */
    @Nullable
    public BrushTool getBrushTool(int item) throws InvalidToolBindException {
        Tool tool = getTool(item);

        if (tool == null || !(tool instanceof BrushTool)) {
            tool = new BrushTool("worldedit.brush.sphere");
            setTool(item, tool);
        }
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.command.tool.Tool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.