diff options
author | TymanWasTaken <tyman@tyman.tech> | 2021-07-06 17:27:11 -0400 |
---|---|---|
committer | TymanWasTaken <tyman@tyman.tech> | 2021-07-06 17:27:11 -0400 |
commit | 804767ebfc26e2a1252bc327def02389b35dfc6e (patch) | |
tree | e3e06c24454080f059355133d633e5a076d85ad3 /src/main/java/com/thatgravyboat/skyblockhud/api | |
parent | 98ee5a2ae8090c061b1e61e7955d793416991822 (diff) | |
download | SkyblockHud-Death-Defied-804767ebfc26e2a1252bc327def02389b35dfc6e.tar.gz SkyblockHud-Death-Defied-804767ebfc26e2a1252bc327def02389b35dfc6e.tar.bz2 SkyblockHud-Death-Defied-804767ebfc26e2a1252bc327def02389b35dfc6e.zip |
fine
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/api')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java | 18 | ||||
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java | 9 |
2 files changed, 3 insertions, 24 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java index db9ad38..b1115ae 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java @@ -43,26 +43,12 @@ public class LeaderboardGetter { 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 - ) - ); + 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()); + cachedScoresList = scores.values().stream().map(name -> SCOREBOARD_CHARACTERS.matcher(name).replaceAll("").trim()).collect(Collectors.toList()); } MinecraftForge.EVENT_BUS.post(new SidebarPostEvent(scoreboard, sidebarObjective, cachedScoresList)); } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java index 8a7aa39..2737ee9 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java @@ -12,14 +12,7 @@ public class SidebarLineUpdateEvent extends Event { public Scoreboard scoreboard; public ScoreObjective objective; - public SidebarLineUpdateEvent( - String rawLine, - String formattedLine, - int score, - int max, - Scoreboard scoreboard, - ScoreObjective objective - ) { + public SidebarLineUpdateEvent(String rawLine, String formattedLine, int score, int max, Scoreboard scoreboard, ScoreObjective objective) { this.rawLine = rawLine; this.formattedLine = formattedLine; this.position = max - score; |