From 6e26741fdce36eb5ae5b6993d5352af7be3573d2 Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Mon, 11 Apr 2022 13:59:54 +0200 Subject: [PATCH] fix: respect block categories in RichMaskParser (#1694) --- .../extension/factory/parser/mask/RichMaskParser.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RichMaskParser.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RichMaskParser.java index 7b0696122..8d92ba90a 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RichMaskParser.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/factory/parser/mask/RichMaskParser.java @@ -85,7 +85,7 @@ public class RichMaskParser extends FaweParser { 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 { 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) {