diff --git a/src/main/java/com/mojang/brigadier/suggestion/Suggestions.java b/src/main/java/com/mojang/brigadier/suggestion/Suggestions.java index c69b145..0abf7e7 100644 --- a/src/main/java/com/mojang/brigadier/suggestion/Suggestions.java +++ b/src/main/java/com/mojang/brigadier/suggestion/Suggestions.java @@ -97,7 +97,7 @@ public class Suggestions { texts.add(suggestion.expand(command, range)); } final List sorted = Lists.newArrayList(texts); - Collections.sort(sorted); + sorted.sort(String::compareToIgnoreCase); return new Suggestions(range, sorted); } } diff --git a/src/test/java/com/mojang/brigadier/suggestion/SuggestionsTest.java b/src/test/java/com/mojang/brigadier/suggestion/SuggestionsTest.java index 213a992..474fa8a 100644 --- a/src/test/java/com/mojang/brigadier/suggestion/SuggestionsTest.java +++ b/src/test/java/com/mojang/brigadier/suggestion/SuggestionsTest.java @@ -26,9 +26,9 @@ public class SuggestionsTest { @Test public void merge_multiple() { - final Suggestions a = new Suggestions(StringRange.at(5), Lists.newArrayList("ar", "az")); - final Suggestions b = new Suggestions(StringRange.between(4, 5), Lists.newArrayList("foo", "qux", "apple")); + final Suggestions a = new Suggestions(StringRange.at(5), Lists.newArrayList("ar", "az", "Az")); + final Suggestions b = new Suggestions(StringRange.between(4, 5), Lists.newArrayList("foo", "qux", "apple", "Bar")); final Suggestions merged = Suggestions.merge("foo b", Lists.newArrayList(a, b)); - assertThat(merged.getList(), equalTo(Lists.newArrayList("apple", "bar", "baz", "foo", "qux"))); + assertThat(merged.getList(), equalTo(Lists.newArrayList("apple", "bar", "Bar", "baz", "bAz", "foo", "qux"))); } } \ No newline at end of file