Package com.sk89q.minecraft.util.commands

Examples of com.sk89q.minecraft.util.commands.Command.min()


            ParameterData[] parameters, Object[] args, CommandContext context)
            throws ParameterException {
        Command annotation = method.getAnnotation(Command.class);
       
        if (annotation != null) {
            if (context.argsLength() < annotation.min()) {
                throw new MissingParameterException();
            }
   
            if (annotation.max() != -1 && context.argsLength() > annotation.max()) {
                throw new UnconsumedParameterException(
View Full Code Here


       
        // Handle the case for old commands where no usage is set and all of its
        // parameters are provider bindings, so its usage information would
        // be blank and would imply that there were no accepted parameters
        if (annotation != null && annotation.usage().isEmpty()
                && (annotation.min() > 0 || annotation.max() > 0)) {
            boolean hasUserParameters = false;
           
            for (ParameterData parameter : parameters) {
                if (parameter.getBinding().getBehavior(parameter) != BindingBehavior.PROVIDES) {
                    hasUserParameters = true;
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.