aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/api
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-07-06 17:27:11 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-07-06 17:27:11 -0400
commit804767ebfc26e2a1252bc327def02389b35dfc6e (patch)
treee3e06c24454080f059355133d633e5a076d85ad3 /src/main/java/com/thatgravyboat/skyblockhud/api
parent98ee5a2ae8090c061b1e61e7955d793416991822 (diff)
downloadSkyblockHud-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.java18
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java9
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;