9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-28 03:19:12 +00:00

Fix some bugs

This commit is contained in:
XiaoMoMi
2024-07-13 20:38:20 +08:00
parent 841d916ad9
commit 476ee138f1
4 changed files with 8 additions and 3 deletions

View File

@@ -64,7 +64,9 @@ public class ActionBarSender {
@SuppressWarnings("DuplicatedCode")
private void updatePrivatePlaceholders() {
this.privateContext.arg(ContextKeys.SCORE_FORMATTED, String.format("%.2f", competition.getRanking().getPlayerScore(player.getName())));
double score = competition.getRanking().getPlayerScore(player.getName());
this.privateContext.arg(ContextKeys.SCORE_FORMATTED, String.format("%.2f", score));
this.privateContext.arg(ContextKeys.SCORE, score);
int rank = competition.getRanking().getPlayerRank(player.getName());
this.privateContext.arg(ContextKeys.RANK, rank != -1 ? String.valueOf(rank) : TranslationManager.miniMessageTranslation(MessageConstants.COMPETITION_NO_RANK.build().key()));
this.privateContext.combine(competition.getPublicContext());

View File

@@ -74,7 +74,9 @@ public class BossBarSender {
@SuppressWarnings("DuplicatedCode")
private void updatePrivatePlaceholders() {
this.privateContext.arg(ContextKeys.SCORE_FORMATTED, String.format("%.2f", competition.getRanking().getPlayerScore(player.getName())));
double score = competition.getRanking().getPlayerScore(player.getName());
this.privateContext.arg(ContextKeys.SCORE_FORMATTED, String.format("%.2f", score));
this.privateContext.arg(ContextKeys.SCORE, score);
int rank = competition.getRanking().getPlayerRank(player.getName());
this.privateContext.arg(ContextKeys.RANK, rank != -1 ? String.valueOf(rank) : TranslationManager.miniMessageTranslation(MessageConstants.COMPETITION_NO_RANK.build().key()));
this.privateContext.combine(competition.getPublicContext());

View File

@@ -107,6 +107,7 @@ public class Migration {
try (BufferedWriter writer = new BufferedWriter(
new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) {
writer.write(sb.toString()
.replace("{score}", "{score_formatted}")
.replace("{size}", "{size_formatted}")
.replace("{SIZE}", "{size}")
.replace("{price}", "{price_formatted}")