geforkt von Mirrors/FastAsyncWorldEdit
Fix RichParser assuming it should be used if its prefix is short than, and contained by, the input
Dieser Commit ist enthalten in:
Ursprung
575b0035df
Commit
66357b8adb
@ -100,11 +100,14 @@ public abstract class RichParser<E> extends InputParser<E> implements AliasedPar
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public E parseFromInput(String input, ParserContext context) throws InputParseException {
|
public E parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||||
|
int i = input.indexOf('[');
|
||||||
|
// Rich parser requires arguments, else, it should not be used
|
||||||
|
if (i == -1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String inputPrefix = input.substring(0, i);
|
||||||
for (String prefix : this.prefixes) {
|
for (String prefix : this.prefixes) {
|
||||||
if (!input.startsWith(prefix)) {
|
if (!inputPrefix.equals(prefix)) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (input.length() < prefix.length()) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String[] arguments = extractArguments(input.substring(prefix.length()), true);
|
String[] arguments = extractArguments(input.substring(prefix.length()), true);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren