From 50885a0b0bd9ad39885b68efb20a1276f16886a3 Mon Sep 17 00:00:00 2001 From: ThatGravyBoat Date: Mon, 27 Sep 2021 16:50:17 +0000 Subject: Prettified Code! --- .../com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/thatgravyboat/skyblockhud/api') 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 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()); } -- cgit