mojira.dev
MC-157426

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.

Comments 0

No comments.

Zonteek

michael

Confirmed

Important

Commands

mojang_internal_2

1.14.4, 19w35a, 19w38b, 19w39a, 19w41a, ..., 19w45a, 19w46a, 19w46b, 1.15 Pre-Release 2, 1.15 Pre-release 3

1.15 Pre-release 4

Retrieved