fix: respect block categories in RichMaskParser (#1694)

This commit is contained in:
Pierre Maurice Schwang 2022-04-11 13:59:54 +02:00 committed by GitHub
parent 8f1ca48bfc
commit 6e26741fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,7 @@ public class RichMaskParser extends FaweParser<Mask> {
if (charMask && input.charAt(0) == '=') {
mask = parseFromInput(char0 + "[" + input.substring(1) + "]", context);
}
if (char0 == '#') {
if (char0 == '#' && command.length() > 1 && command.charAt(1) != '#') {
throw new SuggestInputParseException(
new NoMatchException(Caption.of("fawe.error.parse.unknown-mask", full,
TextComponent
@ -128,6 +128,12 @@ public class RichMaskParser extends FaweParser<Mask> {
input = input.substring(input.indexOf(char0) + 1);
mask = parseFromInput(char0 + "[" + input + "]", context);
}
case '#' -> {
if (!(input.charAt(1) == '#')) {
break;
}
mask = worldEdit.getMaskFactory().parseWithoutRich(full, context);
}
}
}
if (mask == null) {