@@ -28,32 +28,36 @@ public void destoryScoreboard() {
2828 if (board != null ) board .delete ();
2929 }
3030 public void updateLevel () {
31- board . updateLine (0 , "レベル: [%level%]" .replaceAll ("%level%" , Levels .getPlayerLevelColor (player .getLevel ()) + "" + player .getLevel () + ChatColor .RESET ));
31+ updateLine (1 , "レベル: [%level%]" .replaceAll ("%level%" , Levels .getPlayerLevelColor (player .getLevel ()) + "" + player .getLevel () + ChatColor .RESET ));
3232 }
3333
3434 public void updateCoins () {
35- TheJpsPit .getInstance ().getEconomyHook ().ifPresent (economyHook -> board . updateLine (1 , "JP: [%coins%]" .replaceAll ("%coins%" , economyHook .getBalance (player ).toPlainString ())));
35+ TheJpsPit .getInstance ().getEconomyHook ().ifPresent (economyHook -> updateLine (2 , "JP: [%coins%]" .replaceAll ("%coins%" , economyHook .getBalance (player ).toPlainString ())));
3636 }
3737
3838 public void updateRating () {
39- board . updateLine (3 , "K/Dレート: &c%rating%" .replaceAll ("%rating%" , player .getRating () + "" ));
39+ updateLine (4 , "K/Dレート: &c%rating%" .replaceAll ("%rating%" , player .getRating () + "" ));
4040 }
4141
4242 public void updateBestRating () {
43- board . updateLine (4 , "最高レート: &b%bestRating%" .replaceAll ("%bestRating%" , player .getBestRating () + "" ));
43+ updateLine (5 , "最高レート: &b%bestRating%" .replaceAll ("%bestRating%" , player .getBestRating () + "" ));
4444 }
4545
4646 public void updateNeededXp () {
47- board . updateLine (6 , "次のレベルまで:&a%neededXp%" .replaceAll ("%neededXp%" , Levels .getPlayerNeededXP (player .getLevel (),
47+ updateLine (6 , "次のレベルまで:&a%neededXp%" .replaceAll ("%neededXp%" , Levels .getPlayerNeededXP (player .getLevel (),
4848 (int ) player .getXp ()) + "" ));
4949 }
5050
5151 public void updateKillStreaks () {
52- board . updateLine (9 , "連続キル数: &a%streaks%" .replaceAll ("%streaks%" , player .getStreaks () + "" ));
52+ updateLine (9 , "連続キル数: &a%streaks%" .replaceAll ("%streaks%" , player .getStreaks () + "" ));
5353 }
5454
5555 public void updateBestKillStreaks () {
56- board .updateLine (10 , "最高連続キル数: &a%bestStreaks%" .replaceAll ("%bestStreaks%" , player .getBestStreaks () + "" ));
56+ updateLine (10 , "最高連続キル数: &a%bestStreaks%" .replaceAll ("%bestStreaks%" , player .getBestStreaks () + "" ));
57+ }
58+
59+ private void updateLine (int line , String text ) {
60+ board .updateLine (line , ChatColor .translateAlternateColorCodes ('&' , text ));
5761 }
5862
5963 private List <String > init (PitPlayer player ) {
@@ -72,14 +76,14 @@ private List<String> init(PitPlayer player) {
7276 "" ,
7377 "&ejapanpvpserver.net"
7478 ).map (s -> PlaceholderAPI .setPlaceholders (player .getPlayer (), s )).map (s ->
75- s .replaceAll ("%level%" , Levels .getPlayerLevelColor (player .getLevel ()) + "" + player .getLevel () + ChatColor .RESET )
79+ s .replaceAll ("%level%" , Levels .getPlayerLevelColor (player .getLevel ()) + "" + player .getLevel () + ChatColor .RESET )
7680 .replaceAll ("%neededXp%" , Levels .getPlayerNeededXP (player .getLevel (),
7781 (int ) player .getXp ()) + "" )
7882 .replaceAll ("%rating%" , player .getRating () + "%" )
7983 .replaceAll ("%bestRating%" , player .getBestRating () + "%" )
8084 .replaceAll ("%streaks%" , player .getStreaks () + "" )
8185 .replaceAll ("%bestStreaks%" , player .getBestStreaks () + "" )
82- .replaceAll ("%coins" , player .coins ().toPlainString () )
86+ .replaceAll ("%coins% " , player .coins ().intValue () + "" )
8387 ).collect (Collectors .toList ());
8488 }
8589}
0 commit comments