From c93e5ccfdfd100c20836c66ce7f280beaf5d0e6f Mon Sep 17 00:00:00 2001 From: wizjany Date: Sun, 28 Jul 2019 10:02:47 -0400 Subject: [PATCH] Don't suggest ##* for masks. --- .../com/sk89q/worldedit/command/util/SuggestionHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/SuggestionHelper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/SuggestionHelper.java index 3a41711b6..ed5e3aacb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/SuggestionHelper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/SuggestionHelper.java @@ -49,11 +49,12 @@ public final class SuggestionHelper { public static Stream getBlockCategorySuggestions(String tag, boolean allowRandom) { if (tag.isEmpty() || tag.equals("#")) { - return Stream.of("##", "##*"); + return allowRandom ? Stream.of("##", "##*") : Stream.of("##"); } if (tag.startsWith("##")) { if (tag.equals("##")) { - return Stream.concat(Stream.of("##*"), getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(2)).map(s -> "##" + s)); + return Stream.concat(allowRandom ? Stream.of("##*") : Stream.empty(), + getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(2)).map(s -> "##" + s)); } else if (tag.equals("##*") && allowRandom) { return getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(3)).map(s -> "##*" + s); } else {