aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/api
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-07-06 17:20:49 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-07-06 17:20:49 -0400
commitc04ca523f9fb9f7adefa74587db61f76deeae9f0 (patch)
treef148e7bcd9105813d3fe781badcb2cf3892712fd /src/main/java/com/thatgravyboat/skyblockhud/api
parenta8e475fa0a7977f64f072548459d592274169d66 (diff)
downloadSkyblockHud-Death-Defied-c04ca523f9fb9f7adefa74587db61f76deeae9f0.tar.gz
SkyblockHud-Death-Defied-c04ca523f9fb9f7adefa74587db61f76deeae9f0.tar.bz2
SkyblockHud-Death-Defied-c04ca523f9fb9f7adefa74587db61f76deeae9f0.zip
Increase line width
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/api')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java53
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPostEvent.java6
2 files changed, 11 insertions, 48 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java
index b722df1..8d6002b 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java
@@ -33,39 +33,25 @@ public class LeaderboardGetter {
Minecraft mc = Minecraft.getMinecraft();
if (mc.theWorld != null) {
Scoreboard scoreboard = mc.theWorld.getScoreboard();
- ScoreObjective sidebarObjective = scoreboard.getObjectiveInDisplaySlot(
- 1
- );
+ ScoreObjective sidebarObjective = scoreboard.getObjectiveInDisplaySlot(1);
if (
sidebarObjective != null &&
- !MinecraftForge.EVENT_BUS.post(
- new SidebarPreGetEvent(scoreboard, sidebarObjective)
- )
+ !MinecraftForge.EVENT_BUS.post(new SidebarPreGetEvent(scoreboard, sidebarObjective))
) {
- Collection<Score> scoreList = sidebarObjective
- .getScoreboard()
- .getSortedScores(sidebarObjective);
+ Collection<Score> scoreList = sidebarObjective.getScoreboard().getSortedScores(sidebarObjective);
Map<Integer, String> scores = scoreList
.stream()
- .collect(
- Collectors.toMap(Score::getScorePoints, this::getLine)
- );
+ .collect(Collectors.toMap(Score::getScorePoints, this::getLine));
if (!cachedScores.equals(scores)) {
scores.forEach(
(score, name) -> {
- if (
- cachedScores.get(score) == null ||
- !cachedScores.get(score).equals(name)
- ) {
+ if (cachedScores.get(score) == null || !cachedScores.get(score).equals(name)) {
MinecraftForge.EVENT_BUS.post(
new SidebarLineUpdateEvent(
name,
- SCOREBOARD_CHARACTERS
- .matcher(name)
- .replaceAll("")
- .trim(),
+ SCOREBOARD_CHARACTERS.matcher(name).replaceAll("").trim(),
score,
scores.size(),
scoreboard,
@@ -80,35 +66,16 @@ public class LeaderboardGetter {
scores
.values()
.stream()
- .map(
- name ->
- SCOREBOARD_CHARACTERS
- .matcher(name)
- .replaceAll("")
- .trim()
- )
+ .map(name -> SCOREBOARD_CHARACTERS.matcher(name).replaceAll("").trim())
.collect(Collectors.toList());
}
- MinecraftForge.EVENT_BUS.post(
- new SidebarPostEvent(
- scoreboard,
- sidebarObjective,
- cachedScoresList
- )
- );
+ MinecraftForge.EVENT_BUS.post(new SidebarPostEvent(scoreboard, sidebarObjective, cachedScoresList));
}
}
}
public String getLine(Score score) {
- ScorePlayerTeam scorePlayerTeam = score
- .getScoreScoreboard()
- .getPlayersTeam(score.getPlayerName());
- return Utils.removeColor(
- ScorePlayerTeam.formatPlayerName(
- scorePlayerTeam,
- score.getPlayerName()
- )
- );
+ ScorePlayerTeam scorePlayerTeam = score.getScoreScoreboard().getPlayersTeam(score.getPlayerName());
+ return Utils.removeColor(ScorePlayerTeam.formatPlayerName(scorePlayerTeam, score.getPlayerName()));
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPostEvent.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPostEvent.java
index 92ed25e..34d27e6 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPostEvent.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPostEvent.java
@@ -12,11 +12,7 @@ public class SidebarPostEvent extends Event {
public List<String> scores;
public String[] arrayScores;
- public SidebarPostEvent(
- Scoreboard scoreboard,
- ScoreObjective objective,
- List<String> scores
- ) {
+ public SidebarPostEvent(Scoreboard scoreboard, ScoreObjective objective, List<String> scores) {
this.scoreboard = scoreboard;
this.objective = objective;
this.scores = scores;