Command outputs which should be sorted don't get sorted
Steps to reproduce:
- Run the commands
/tag @s add a /tag @s add b /tag @s add p /tag @s add q /tag @s list
- The feedback is
Player has 4 tags: p, a, q, b
but it should be ordered alphabetically
Player has 4 tags: a, b, p, q
Other affected commands: /scoreboard players list and /team list <team>
Code analysis (official mappings)
public static Component formatAndSortList(Collection in, Function formatter) { if (in.isEmpty()) { return new TextComponent(""); } else if (in.size() == 1) { return (Component)formatter.apply(in.iterator().next()); } else { ArrayList sorted = Lists.newArrayList(in); sorted.sort(Comparable::compareTo); return formatList(in, formatter); } }
The method formatAndSortList in ComponentUtils ignores the sorting result.