Skip to content

Commit 5acacaf

Browse files
committed
fix:balのnull
1 parent e3ce0ec commit 5acacaf

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/com/github/elic0de/thejpspit/scoreboard/GameScoreboard.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ public void update() {
2424
}
2525

2626
public List<String> boardLines(PitPlayer player) {
27-
AtomicReference<BigDecimal> bigDecimal = new AtomicReference<>(BigDecimal.ZERO);
28-
TheJpsPit.getInstance().getEconomyHook().ifPresent(economyHook -> bigDecimal.set(
29-
economyHook.getBalance(player)));
30-
31-
return Stream.of(
27+
final List<String> strings = Stream.of(
3228
"",
3329
"レベル: [%level%]",
3430
"JP: [%coins%]",
@@ -49,8 +45,11 @@ public List<String> boardLines(PitPlayer player) {
4945
.replaceAll("%bestRating%", player.getBestRating() + "%")
5046
.replaceAll("%streaks%", player.getStreaks() + "")
5147
.replaceAll("%bestStreaks%", player.getBestStreaks() + "")
52-
.replaceAll("%coins%", bigDecimal + "")
5348
).collect(Collectors.toList());
49+
50+
TheJpsPit.getInstance().getEconomyHook().ifPresent(economyHook -> strings.stream().map(s -> s.replaceAll("%coins%", economyHook.getBalance(player) + "")).collect(Collectors.toList()));
51+
52+
return strings;
5453
}
5554

5655
}

0 commit comments

Comments
 (0)