@Override public void postCommand() { super.postCommand(); } }
@Override public void preCommand() { super.preCommand(); }
public RegisteredCommand createRegisteredCommand(BaseCommand command, String cmdName, Method method, String prefSubCommand) { return new RegisteredCommand(command, cmdName, method, prefSubCommand); }
void invoke(CommandIssuer sender, List<String> args, CommandOperationContext context) { if (!scope.canExecute(sender, this)) { return; } preCommand(); try { this.manager.conditions.validateConditions(context); Map<String, Object> passedArgs = resolveContexts(sender, args); if (passedArgs == null) return; method.invoke(scope, passedArgs.values().toArray()); } catch (Exception e) { handleException(sender, args, e); } postCommand(); } public void preCommand() {}
public String getDescription(){ return this.command.getHelpText(); }
public boolean requiresPermission(String permission) { return getRequiredPermissions().contains(permission) || scope.requiresPermission(permission); }
command.handleException(sender, Arrays.asList(args), e);
subCommands.put(subcmd, cmd); cmd.addSubcommands(cmdList);
default String getDescription() { final RegisteredCommand cmd = this.getDefaultRegisteredCommand(); if (cmd != null) { return cmd.getHelpText(); } BaseCommand defCommand = getDefCommand(); if (defCommand != null && defCommand.description != null) { return defCommand.description; } return ""; }
@Override public void postCommand() { super.postCommand(); timing.stopTiming(); } }
@Override public void preCommand() { this.timing.startTiming(); super.preCommand(); }
@Override public RegisteredCommand createRegisteredCommand(BaseCommand command, String cmdName, Method method, String prefSubCommand) { return new RegisteredCommand(command, cmdName, method, prefSubCommand); }
@Override public void postCommand() { super.postCommand(); this.timing.stopTiming(); } }
@Override public void preCommand() { timing.startTiming(); super.preCommand(); }