mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-28 12:07:42 +01:00
Fixed syntax starting with an unspecified length argument
This commit is contained in:
parent
02ccb42695
commit
431d20ef73
@ -121,7 +121,7 @@ public class CommandDispatcher {
|
|||||||
|
|
||||||
for (CommandSyntax syntax : syntaxes) {
|
for (CommandSyntax syntax : syntaxes) {
|
||||||
final Argument<?>[] arguments = syntax.getArguments();
|
final Argument<?>[] arguments = syntax.getArguments();
|
||||||
final String[] argsValues = new String[arguments.length];
|
final String[] argsValues = new String[Byte.MAX_VALUE];
|
||||||
|
|
||||||
boolean syntaxCorrect = true;
|
boolean syntaxCorrect = true;
|
||||||
// The current index in the raw command string arguments
|
// The current index in the raw command string arguments
|
||||||
@ -157,22 +157,22 @@ public class CommandDispatcher {
|
|||||||
correctionResult = argument.getCorrectionResult(argValueString);
|
correctionResult = argument.getCorrectionResult(argValueString);
|
||||||
if (correctionResult == Argument.SUCCESS) {
|
if (correctionResult == Argument.SUCCESS) {
|
||||||
correct = true;
|
correct = true;
|
||||||
argsValues[argIndex] = argValueString;
|
argsValues[argCount] = argValueString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Argument is either single-word or can accept optional delimited space(s)
|
// Argument is either single-word or can accept optional delimited space(s)
|
||||||
for (int i = argIndex; i < args.length; i++) {
|
for (int i = argIndex; i < args.length; i++) {
|
||||||
final String arg = args[i];
|
final String rawArg = args[i];
|
||||||
|
|
||||||
argValue.append(arg);
|
argValue.append(rawArg);
|
||||||
|
|
||||||
final String argValueString = argValue.toString();
|
final String argValueString = argValue.toString();
|
||||||
|
|
||||||
correctionResult = argument.getCorrectionResult(argValueString);
|
correctionResult = argument.getCorrectionResult(argValueString);
|
||||||
if (correctionResult == Argument.SUCCESS) {
|
if (correctionResult == Argument.SUCCESS) {
|
||||||
correct = true;
|
correct = true;
|
||||||
argsValues[argIndex] = argValueString;
|
argsValues[argCount] = argValueString;
|
||||||
argIndex = i + 1;
|
argIndex = i + 1;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user