diff options
author | ThatGravyBoat <ThatGravyBoat@users.noreply.github.com> | 2021-09-27 16:50:17 +0000 |
---|---|---|
committer | GitHub Action <actions@github.com> | 2021-09-27 16:50:17 +0000 |
commit | 50885a0b0bd9ad39885b68efb20a1276f16886a3 (patch) | |
tree | 070e35e2bcc8ba551ec7f2517992182911c83859 /src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java | |
parent | 06c495fd067ed5c16b34322d41e9674319e09506 (diff) | |
download | SkyblockHud-Death-Defied-50885a0b0bd9ad39885b68efb20a1276f16886a3.tar.gz SkyblockHud-Death-Defied-50885a0b0bd9ad39885b68efb20a1276f16886a3.tar.bz2 SkyblockHud-Death-Defied-50885a0b0bd9ad39885b68efb20a1276f16886a3.zip |
Prettified Code!
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java index ca73b66..3c59360 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java @@ -45,13 +45,11 @@ public class LeaderboardGetter { Map<Integer, String> scores = scoreList.stream().collect(Collectors.toMap(Score::getScorePoints, this::getLine, (s1, s2) -> s1)); if (!cachedScores.equals(scores)) { - scores.forEach( - (score, name) -> { - if (cachedScores.get(score) == null || !cachedScores.get(score).equals(name)) { - MinecraftForge.EVENT_BUS.post(new SidebarLineUpdateEvent(name, SCOREBOARD_CHARACTERS.matcher(name).replaceAll("").trim(), score, scores.size(), scoreboard, sidebarObjective)); - } + scores.forEach((score, name) -> { + if (cachedScores.get(score) == null || !cachedScores.get(score).equals(name)) { + MinecraftForge.EVENT_BUS.post(new SidebarLineUpdateEvent(name, SCOREBOARD_CHARACTERS.matcher(name).replaceAll("").trim(), score, scores.size(), scoreboard, sidebarObjective)); } - ); + }); cachedScores = scores; cachedScoresList = scores.values().stream().map(name -> SCOREBOARD_CHARACTERS.matcher(name).replaceAll("").trim()).collect(Collectors.toList()); } |