mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix RichParser assuming it should be used if its prefix is short than, and contained by, the input
This commit is contained in:
parent
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 {
|
||||||
for (String prefix : this.prefixes) {
|
int i = input.indexOf('[');
|
||||||
if (!input.startsWith(prefix)) {
|
// Rich parser requires arguments, else, it should not be used
|
||||||
continue;
|
if (i == -1) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
if (input.length() < prefix.length()) {
|
String inputPrefix = input.substring(0, i);
|
||||||
|
for (String prefix : this.prefixes) {
|
||||||
|
if (!inputPrefix.equals(prefix)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String[] arguments = extractArguments(input.substring(prefix.length()), true);
|
String[] arguments = extractArguments(input.substring(prefix.length()), true);
|
||||||
|
Loading…
Reference in New Issue
Block a user