Package com.sk89q.craftbook.mechanics.ic

Examples of com.sk89q.craftbook.mechanics.ic.ICVerificationException


        public void checkPlayer(ChangedSign sign, LocalPlayer player) throws ICVerificationException {

            String[] parts = RegexUtil.PIPE_PATTERN.split(sign.getLine(2));
            if(parts.length == 1) {
                if(!VariableCommands.hasVariablePermission(((BukkitPlayer) player).getPlayer(), "global", parts[0], "use"))
                    throw new ICVerificationException("You do not have permissions to use the global variable namespace!");
            } else
                if(!VariableCommands.hasVariablePermission(((BukkitPlayer) player).getPlayer(), parts[0], parts[1], "use"))
                    throw new ICVerificationException("You do not have permissions to use the " + parts[0] + " variable namespace!");
        }
View Full Code Here


        public void verify(ChangedSign sign) throws ICVerificationException {
            try {
                String[] parts = RegexUtil.PIPE_PATTERN.split(sign.getLine(2));
                if(parts.length == 1) {
                    if(!VariableManager.instance.hasVariable(sign.getLine(2), "global"))
                        throw new ICVerificationException("Unknown Variable!");
                } else
                    if(!VariableManager.instance.hasVariable(parts[1], parts[0]))
                        throw new ICVerificationException("Unknown Variable!");
                Validate.notNull(MathFunction.parseFunction(sign.getLine(3).split(":")[0]));
                Double.parseDouble(sign.getLine(3).split(":")[1]);
            } catch(NumberFormatException e) {
                throw new ICVerificationException("Amount must be a number!");
            } catch(IllegalArgumentException e) {
                throw new ICVerificationException("Invalid Function!");
            } catch(ArrayIndexOutOfBoundsException e) {
                throw new ICVerificationException("Both Function and Amount must be entered, seperated by a colon (:)!");
            }
        }
View Full Code Here

        public void checkPlayer(ChangedSign sign, LocalPlayer player) throws ICVerificationException {

            String[] parts = RegexUtil.PIPE_PATTERN.split(sign.getLine(2));
            if(parts.length == 1) {
                if(!VariableCommands.hasVariablePermission(((BukkitPlayer) player).getPlayer(), "global", parts[0], "use"))
                    throw new ICVerificationException("You do not have permissions to use the global variable namespace!");
            } else
                if(!VariableCommands.hasVariablePermission(((BukkitPlayer) player).getPlayer(), parts[0], parts[1], "use"))
                    throw new ICVerificationException("You do not have permissions to use the " + parts[0] + " variable namespace!");
        }
View Full Code Here

        @Override
        public void verify(ChangedSign sign) throws ICVerificationException {
            String[] parts = RegexUtil.PIPE_PATTERN.split(sign.getLine(2));
            if(parts.length == 1) {
                if(!VariableManager.instance.hasVariable(sign.getLine(2), "global"))
                    throw new ICVerificationException("Unknown Variable!");
            } else
                if(!VariableManager.instance.hasVariable(parts[1], parts[0]))
                    throw new ICVerificationException("Unknown Variable!");
        }
View Full Code Here

        public void checkPlayer(ChangedSign sign, LocalPlayer player) throws ICVerificationException {

            String[] parts = RegexUtil.PIPE_PATTERN.split(sign.getLine(2));
            if(parts.length == 1) {
                if(!VariableCommands.hasVariablePermission(((BukkitPlayer) player).getPlayer(), "global", parts[0], "use"))
                    throw new ICVerificationException("You do not have permissions to use the global variable namespace!");
            } else
                if(!VariableCommands.hasVariablePermission(((BukkitPlayer) player).getPlayer(), parts[0], parts[1], "use"))
                    throw new ICVerificationException("You do not have permissions to use the " + parts[0] + " variable namespace!");
        }
View Full Code Here

        public void verify(ChangedSign sign) throws ICVerificationException {
            try {
                String[] parts = RegexUtil.PIPE_PATTERN.split(sign.getLine(2));
                if(parts.length == 1) {
                    if(!VariableManager.instance.hasVariable(sign.getLine(2), "global"))
                        throw new ICVerificationException("Unknown Variable!");
                } else
                    if(!VariableManager.instance.hasVariable(parts[1], parts[0]))
                        throw new ICVerificationException("Unknown Variable!");
                Double.parseDouble(sign.getLine(3));
            } catch(NumberFormatException e) {
                throw new ICVerificationException("Amount must be a number!");
            }
        }
View Full Code Here

        @Override
        public void verify(ChangedSign sign) throws ICVerificationException {

            ItemStack item = ItemSyntax.getItem(sign.getLine(2));
            if(item == null)
                throw new ICVerificationException("Invalid item to detect!");
        }
View Full Code Here

        public void verify(ChangedSign sign) throws ICVerificationException {

            try {
                Integer.parseInt(sign.getLine(2));
            } catch (Exception ignored) {
                throw new ICVerificationException("The third line needs to be a number.");
            }
        }
View Full Code Here

        @Override
        public void verify(ChangedSign sign) throws ICVerificationException {

            if(!SearchArea.createArea(BukkitUtil.toSign(sign).getBlock(), sign.getLine(2)).isValid())
                throw new ICVerificationException("Invalid SearchArea on line 3!");
        }
View Full Code Here

                    try {
                        effectID = Effect.valueOf(eff[0]).getId();
                    }
                    catch(Exception ignored){}
                }
                if (Effect.getById(effectID) == null) throw new ICVerificationException("Invalid effect!");
                try {
                    effectData = Integer.parseInt(eff[1]);
                } catch (Exception e) {
                    effectData = 0;
                }
                if (effectID == 2001 && BlockType.fromID(effectData) == null) throw new ICVerificationException("Invalid block ID for effect!");
            }
            catch(Exception e) {
                throw new ICVerificationException("Invalid effect!");
            }
        }
View Full Code Here

TOP

Related Classes of com.sk89q.craftbook.mechanics.ic.ICVerificationException

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.