diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-09-27 14:17:41 -0230 |
---|---|---|
committer | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-09-27 14:17:41 -0230 |
commit | f1fd06d889162ac72395ef66043970cfe42cde5e (patch) | |
tree | 1e306d5817eac77ac44ef59085120882f8824d7a /src/main/java/com/thatgravyboat/skyblockhud/api | |
parent | 7809a1362c9644c9bfb69d8563a13e3f1ed3354a (diff) | |
download | SkyblockHud-Death-Defied-f1fd06d889162ac72395ef66043970cfe42cde5e.tar.gz SkyblockHud-Death-Defied-f1fd06d889162ac72395ef66043970cfe42cde5e.tar.bz2 SkyblockHud-Death-Defied-f1fd06d889162ac72395ef66043970cfe42cde5e.zip |
I dont even know when I coded this.
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/api')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java index 2312910..ca73b66 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java @@ -2,6 +2,7 @@ package com.thatgravyboat.skyblockhud.api; import static com.thatgravyboat.skyblockhud.ComponentHandler.SCOREBOARD_CHARACTERS; +import com.thatgravyboat.skyblockhud.SkyblockHud; import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent; import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent; import com.thatgravyboat.skyblockhud.api.events.SidebarPreGetEvent; @@ -35,13 +36,13 @@ public class LeaderboardGetter { if (ticks % 5 != 0) return; Minecraft mc = Minecraft.getMinecraft(); - if (mc.theWorld != null) { + if (mc.theWorld != null && SkyblockHud.hasSkyblockScoreboard()) { Scoreboard scoreboard = mc.theWorld.getScoreboard(); ScoreObjective sidebarObjective = scoreboard.getObjectiveInDisplaySlot(1); if (sidebarObjective != null && !MinecraftForge.EVENT_BUS.post(new SidebarPreGetEvent(scoreboard, sidebarObjective))) { Collection<Score> scoreList = sidebarObjective.getScoreboard().getSortedScores(sidebarObjective); - Map<Integer, String> scores = scoreList.stream().collect(Collectors.toMap(Score::getScorePoints, this::getLine)); + Map<Integer, String> scores = scoreList.stream().collect(Collectors.toMap(Score::getScorePoints, this::getLine, (s1, s2) -> s1)); if (!cachedScores.equals(scores)) { scores.forEach( |