Package com.sk89q.craftbook

Examples of com.sk89q.craftbook.LocalPlayer.printError()


                base = getBlockBase(event.getBlock());
                ItemStack toDrop = new ItemStack(base.getType(), getBlocks(sign, other), base.getData());
                event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), toDrop);
            } catch (InvalidMechanismException e) {
                if(e.getMessage() != null)
                    player.printError(e.getMessage());
            }
        }
    }

    public boolean removeBlocks(ChangedSign s, ChangedSign other, int amount) {
View Full Code Here


        if (CraftBookPlugin.inst().getConfiguration().safeDestruction && (gateBlock == null || gateBlock.getType() == Material.AIR || gateBlock.getType() == player.getHeldItemInfo().getType()) && isValidGateBlock(sign, smallSearchSize, player.getHeldItemInfo(), false)) {

            if (!player.hasPermission("craftbook.mech.gate.restock")) {
                if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
                    player.printError("mech.restock-permission");
                return;
            }

            int amount = 1;
            if (event.getPlayer().isSneaking())
View Full Code Here

            return;
        }

        if (!player.hasPermission("craftbook.mech.gate.use")) {
            if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
                player.printError("mech.use-permission");
            return;
        }

        if(!ProtectionUtil.canUse(event.getPlayer(), event.getClickedBlock().getLocation(), event.getBlockFace(), event.getAction())) {
            if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
View Full Code Here

            return;
        }

        if(!ProtectionUtil.canUse(event.getPlayer(), event.getClickedBlock().getLocation(), event.getBlockFace(), event.getAction())) {
            if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
                player.printError("area.use-permissions");
            return;
        }

        if (toggleGates(player, event.getClickedBlock(), smallSearchSize, null))
            player.print("mech.gate.toggle");
View Full Code Here

        }

        if (toggleGates(player, event.getClickedBlock(), smallSearchSize, null))
            player.print("mech.gate.toggle");
        else
            player.printError("mech.gate.not-found");

        event.setCancelled(true);
    }

    @EventHandler(priority = EventPriority.HIGH)
View Full Code Here

        LocalPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());

        if (event.getLine(1).equalsIgnoreCase("[Gate]")) {
            if(!player.hasPermission("craftbook.mech.gate")) {
                if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
                    player.printError("mech.create-permission");
                SignUtil.cancelSign(event);
                return;
            }
            // get the material that this gate should toggle and verify it
            String line0 = event.getLine(0).trim();
View Full Code Here

            }
            // get the material that this gate should toggle and verify it
            String line0 = event.getLine(0).trim();
            if (line0 != null && !line0.isEmpty()) {
                if (!isValidGateBlock(new ItemInfo(line0))) {
                    player.printError("Line 1 needs to be a valid block id.");
                    SignUtil.cancelSign(event);
                    return;
                }
            }
            event.setLine(1, "[Gate]");
View Full Code Here

                event.setLine(3, "0");
            player.print("mech.gate.create");
        } else if (event.getLine(1).equalsIgnoreCase("[DGate]")) {
            if (!player.hasPermission("craftbook.mech.gate") && !player.hasPermission("craftbook.mech.dgate")) {
                if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
                    player.printError("mech.create-permission");
                SignUtil.cancelSign(event);
                return;
            }
            // get the material that this gate should toggle and verify it
            String line0 = event.getLine(0).trim();
View Full Code Here

            }
            // get the material that this gate should toggle and verify it
            String line0 = event.getLine(0).trim();
            if (line0 != null && !line0.isEmpty()) {
                if (!isValidGateBlock(new ItemInfo(line0))) {
                    player.printError("mech.gate.valid-item");
                    SignUtil.cancelSign(event);
                    return;
                }
            }
            event.setLine(1, "[DGate]");
View Full Code Here

        LocalPlayer player = CraftBookPlugin.inst().wrapPlayer(event.getPlayer());

        if(!ProtectionUtil.canBuild(event.getPlayer(), event.getBlock().getLocation(), false)) {
            if(CraftBookPlugin.inst().getConfiguration().showPermissionMessages)
                player.printError("area.break-permissions");
            return;
        }

        int amount = getBlocks(sign);
        if (amount > 0) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.