Skip to content
Permalink
Browse files

Fix other minor suggestion bugs

  • Loading branch information...
kenzierocks committed Jul 28, 2019
1 parent 76b608f commit 50cea37439ed048f0a28e14535fb855987aef027
@@ -51,7 +51,7 @@ private SuggestionHelper() {
if (tag.isEmpty() || tag.equals("#")) {
return Stream.of("##", "##*");
}
if (tag.startsWith("#")) {
if (tag.startsWith("##")) {
if (tag.equals("##")) {
return Stream.concat(Stream.of("##*"), getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(2)).map(s -> "##" + s));
} else if (tag.equals("##*") && allowRandom) {
@@ -111,7 +111,8 @@ public static void register(CommandDispatcher<ServerCommandSource> dispatcher, o
// Ensure there is a space!
if (suggestion.getStart() == suggestion.getEnd()
&& suggestion.getEnd() == builder.getInput().length()
&& !builder.getInput().endsWith(" ")) {
&& !builder.getInput().endsWith(" ")
&& !builder.getInput().endsWith("\"")) {
suggestionText = " " + suggestionText;
}
result.add(new Suggestion(
@@ -103,7 +103,8 @@ public static void register(CommandDispatcher<CommandSource> dispatcher, org.eng
// Ensure there is a space!
if (suggestion.getStart() == suggestion.getEnd()
&& suggestion.getEnd() == builder.getInput().length()
&& !builder.getInput().endsWith(" ")) {
&& !builder.getInput().endsWith(" ")
&& !builder.getInput().endsWith("\"")) {
suggestionText = " " + suggestionText;
}
result.add(new Suggestion(

0 comments on commit 50cea37

Please sign in to comment.
You can’t perform that action at this time.