Fail if any mask fails to parse (#1465)

This commit is contained in:
Octavia Togami 2020-08-03 20:23:02 -07:00 committed by GitHub
parent b0d5100e4e
commit f2e5c52f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,13 +98,18 @@ public Mask parseFromInput(String input, ParserContext context) throws InputPars
continue;
}
Mask match = null;
for (InputParser<Mask> parser : getParsers()) {
Mask match = parser.parseFromInput(component, context);
match = parser.parseFromInput(component, context);
if (match != null) {
masks.add(match);
break;
}
}
if (match == null) {
throw new NoMatchException(TranslatableComponent.of("worldedit.error.no-match", TextComponent.of(component)));
}
masks.add(match);
}
switch (masks.size()) {