Fix incorrect inputQueue usage in some argument types
This commit is contained in:
parent
33c51967e2
commit
c26fbcb6fc
8 changed files with 13 additions and 7 deletions
|
|
@ -181,14 +181,15 @@ public final class BooleanArgument<C> extends CommandArgument<C, Boolean> {
|
|||
commandContext
|
||||
));
|
||||
}
|
||||
inputQueue.remove();
|
||||
|
||||
if (!this.liberal) {
|
||||
if (input.equalsIgnoreCase("true")) {
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(true);
|
||||
}
|
||||
|
||||
if (input.equalsIgnoreCase("false")) {
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(false);
|
||||
}
|
||||
|
||||
|
|
@ -198,10 +199,12 @@ public final class BooleanArgument<C> extends CommandArgument<C, Boolean> {
|
|||
final String uppercaseInput = input.toUpperCase();
|
||||
|
||||
if (LIBERAL_TRUE.contains(uppercaseInput)) {
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(true);
|
||||
}
|
||||
|
||||
if (LIBERAL_FALSE.contains(uppercaseInput)) {
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ public final class CharArgument<C> extends CommandArgument<C, Character> {
|
|||
return ArgumentParseResult.failure(new CharParseException(input, commandContext));
|
||||
}
|
||||
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(input.charAt(0));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue