Skip to content

Fix objective_name_top & objective_score_top not sorted correctly (issue #75)#76

Merged
Patbox merged 1 commit intoPatbox:1.21.5from
ItsJustMiaouss:fix/1.21.5/issue-75
Apr 28, 2025
Merged

Fix objective_name_top & objective_score_top not sorted correctly (issue #75)#76
Patbox merged 1 commit intoPatbox:1.21.5from
ItsJustMiaouss:fix/1.21.5/issue-75

Conversation

@ItsJustMiaouss
Copy link
Contributor

objective_name_top & objective_score_top placeholders are now sorted correctly

My guess is that ServerScoreboard#getScoreboardEntries uses a Map which is not ordered by the score value.

So in here:

Collection<ScoreboardEntry> scoreboardEntries = scoreboard.getScoreboardEntries(scoreboardObjective);

We have to sort it manually after getting the score values. So I used a List instead of a Collection to use the List#sort() method.

It's working, I have tested in-game :)

2025-04-28_21 24 22

* objective_name_top & objective_score_top placeholders are now sorted correctly
@ItsJustMiaouss ItsJustMiaouss changed the title Fix issue #75 Fix objective_name_top & objective_score_top not sorted correctly (issue #75) Apr 28, 2025
@Patbox Patbox merged commit 03c1157 into Patbox:1.21.5 Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants