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;
}
}
Aggregations