Search in sources :

Example 1 with Handler

use of com.iCo6.command.Handler in project Core by iConomy.

the class iConomy method onCommand.

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    Handler handler = Commands.getHandler(command.getName());
    String split = "/" + command.getName().toLowerCase();
    for (int i = 0; i < args.length; i++) {
        split = split + " " + args[i];
    }
    Messaging.save(sender);
    Commands.save(split);
    Commands.parse();
    if (Commands.getHandler() != null)
        handler = Commands.getHandler();
    if (handler == null)
        return false;
    try {
        return handler.perform(sender, Commands.getArguments());
    } catch (InvalidUsage ex) {
        Messaging.send(sender, ex.getMessage());
        return false;
    }
}
Also used : InvalidUsage(com.iCo6.command.exceptions.InvalidUsage) ResultSetHandler(com.iCo6.util.org.apache.commons.dbutils.ResultSetHandler) Handler(com.iCo6.command.Handler)

Aggregations

Handler (com.iCo6.command.Handler)1 InvalidUsage (com.iCo6.command.exceptions.InvalidUsage)1 ResultSetHandler (com.iCo6.util.org.apache.commons.dbutils.ResultSetHandler)1