diff --git a/core/src/main/java/com/boydti/fawe/command/SuggestInputParseException.java b/core/src/main/java/com/boydti/fawe/command/SuggestInputParseException.java index 2ecc43c9..546aff67 100644 --- a/core/src/main/java/com/boydti/fawe/command/SuggestInputParseException.java +++ b/core/src/main/java/com/boydti/fawe/command/SuggestInputParseException.java @@ -34,8 +34,9 @@ public class SuggestInputParseException extends InputParseException { return MainUtil.prepend(prefix, suggestions); } - public void prepend(String input) { + public SuggestInputParseException prepend(String input) { this.prefix = input + prefix; + return this; } public static SuggestInputParseException get(Throwable e) { diff --git a/core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java b/core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java index f6e3b548..250b5f54 100644 --- a/core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java +++ b/core/src/main/java/com/sk89q/worldedit/extension/factory/HashTagPatternParser.java @@ -162,7 +162,7 @@ public class HashTagPatternParser extends InputParser{ if (len != 3) { if (len <= 3) { if (split3.get(len - 1).endsWith(":")) { - throw new SuggestInputParseException(null, ALL_PATTERNS); + throw new SuggestInputParseException(null, ALL_PATTERNS).prepend(input); } String[] args = new String[]{"", "", ""}; throw new SuggestInputParseException(input, input + ":" + StringMan.join(Arrays.copyOfRange(args, len, 3), ":")); @@ -240,7 +240,7 @@ public class HashTagPatternParser extends InputParser{ patterns.add(catchSuggestion(input, token, context)); } if (patterns.isEmpty()) { - throw new SuggestInputParseException(null, ALL_PATTERNS); + throw new SuggestInputParseException(null, ALL_PATTERNS).prepend(input); } return new LinearBlockPattern(patterns.toArray(new Pattern[patterns.size()])); } @@ -251,12 +251,12 @@ public class HashTagPatternParser extends InputParser{ patterns.add(catchSuggestion(input, token, context)); } if (patterns.isEmpty()) { - throw new SuggestInputParseException(null, ALL_PATTERNS); + throw new SuggestInputParseException(null, ALL_PATTERNS).prepend(input); } return new Linear3DBlockPattern(patterns.toArray(new Pattern[patterns.size()])); } default: - throw new SuggestInputParseException(split2[0], DELEGATE_PATTERNS); + throw new SuggestInputParseException(input, DELEGATE_PATTERNS); } } throw new SuggestInputParseException(input, MainUtil.joinArrayGeneric(SIMPLE_PATTERNS, DELEGATE_PATTERNS));