mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
Don't require a commands arguments to not exceed registered resolvers
This is resolving a reported issue where putting extra arguments at the end of a command cause that command to not execute
This commit is contained in:
@@ -79,7 +79,11 @@ class CommandRouter {
|
||||
private boolean isProbableMatch(RegisteredCommand c, String[] args, boolean completion) {
|
||||
int required = c.requiredResolvers;
|
||||
int optional = c.optionalResolvers;
|
||||
return args.length <= required + optional && (completion || args.length >= required);
|
||||
if (completion) {
|
||||
return args.length <= required + optional;
|
||||
} else {
|
||||
return args.length >= required;
|
||||
}
|
||||
}
|
||||
|
||||
RouteSearch routeCommand(RootCommand command, String commandLabel, String[] args, boolean completion) {
|
||||
|
||||
Reference in New Issue
Block a user