diff options
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; |