/** * This is ran before any command operation has been performed. * * @param issuer * The user who executed the command. * @param commandLabel * The label the user used to execute the command. This is not the command name, but their input. * When there is multiple aliases, this is which alias was used * @param args * The arguments passed to the command when executing it. * @param isAsync * Whether the command is executed off of the main thread. * * @return The context which is being registered to the {@link CommandManager}'s {@link * CommandManager#commandOperationContext thread local stack}. */ private CommandOperationContext preCommandOperation(CommandIssuer issuer, String commandLabel, String[] args, boolean isAsync) { Stack<CommandOperationContext> contexts = CommandManager.commandOperationContext.get(); CommandOperationContext context = this.manager.createCommandOperationContext(this, issuer, commandLabel, args, isAsync); contexts.push(context); lastCommandOperationContext = context; execSubcommand = null; execLabel = commandLabel; origArgs = args; return context; }