diff --git a/core/src/main/java/dev/nandi0813/practice/manager/fight/match/type/duel/Duel.java b/core/src/main/java/dev/nandi0813/practice/manager/fight/match/type/duel/Duel.java index 9b226554..18ad4659 100644 --- a/core/src/main/java/dev/nandi0813/practice/manager/fight/match/type/duel/Duel.java +++ b/core/src/main/java/dev/nandi0813/practice/manager/fight/match/type/duel/Duel.java @@ -29,6 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; @Getter public class Duel extends Match implements Team { @@ -108,9 +109,11 @@ public DuelRound getCurrentRound() { @Override public int getWonRounds(Player player) { + UUID playerUuid = player.getUniqueId(); int wonRounds = 0; for (Round round : this.rounds.values()) { - if (((DuelRound) round).getRoundWinner() == player) + Player winner = ((DuelRound) round).getRoundWinner(); + if (winner != null && winner.getUniqueId().equals(playerUuid)) wonRounds++; } return wonRounds; diff --git a/core/src/main/java/dev/nandi0813/practice/manager/sidebar/adapter/AdapterUtil.java b/core/src/main/java/dev/nandi0813/practice/manager/sidebar/adapter/AdapterUtil.java index ed0af6cd..6b56bb53 100644 --- a/core/src/main/java/dev/nandi0813/practice/manager/sidebar/adapter/AdapterUtil.java +++ b/core/src/main/java/dev/nandi0813/practice/manager/sidebar/adapter/AdapterUtil.java @@ -154,20 +154,17 @@ public static Component getRoundString(int rounds, int wonRounds, Component wonC } Component component = Component.empty(); - boolean firstNotWon = true; String roundSymbol = getRoundSymbol(); Component wonSymbol = wonColor == null ? Component.text(roundSymbol) : wonColor.append(Component.text(roundSymbol)); + Component notWonSymbol = Component.text(roundSymbol, NamedTextColor.GRAY); for (int i = 1; i <= rounds; i++) { if (i <= clampedWonRounds) { component = component.append(wonSymbol); - } else if (firstNotWon) { - component = component.append(Component.text(roundSymbol, NamedTextColor.GRAY)); - firstNotWon = false; } else { - component = component.append(Component.text(roundSymbol)); + component = component.append(notWonSymbol); } }