From cba7c21ce5842d17f5cb6a3aa1f30a6060cdd168 Mon Sep 17 00:00:00 2001 From: mrlasagne <61229161+mrlasagne@users.noreply.github.com> Date: Mon, 13 Apr 2020 22:34:15 +0200 Subject: [PATCH 1/2] Fix special masks issue This fixes the issue where masks other than SimpleBlock masks (like Offset mask or negate mask) would not work. The issue was caused by parseFromListInput() who would throw SuggestInputParseException if the input was not a valid block definition. But as the parser was catching NoMatchException only, this was causing an error and the MaskFactory was broken. --- .../extension/factory/parser/mask/BlocksMaskParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlocksMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlocksMaskParser.java index c4208dd94..d66d59ba9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlocksMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlocksMaskParser.java @@ -56,7 +56,7 @@ public class BlocksMaskParser extends InputParser { return null; } return new BlockMask(context.getExtent(), holders); - } catch (NoMatchException e) { + } catch (InputParseException e) { return null; } } From 97d73889cc3d93c70ced55099b30f8c4e89744b6 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Thu, 16 Apr 2020 17:22:22 +0100 Subject: [PATCH 2/2] Remove _ from tree type as easy fix for actually typing the correct tree type --- .../src/main/java/com/sk89q/worldedit/util/TreeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java index ad9b798b1..a98307acb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java @@ -162,7 +162,7 @@ public class TreeGenerator { */ @Nullable public static TreeType lookup(String name) { - return lookup.get(name.toLowerCase(Locale.ROOT)); + return lookup.get(name.replace("_", "").toLowerCase(Locale.ROOT)); } }