diff --git a/src/main/scala/com/github/unchama/seichiassist/data/descrptions/PlayerStatsLoreGenerator.scala b/src/main/scala/com/github/unchama/seichiassist/data/descrptions/PlayerStatsLoreGenerator.scala index b3838576dd..fcea2d0ff7 100644 --- a/src/main/scala/com/github/unchama/seichiassist/data/descrptions/PlayerStatsLoreGenerator.scala +++ b/src/main/scala/com/github/unchama/seichiassist/data/descrptions/PlayerStatsLoreGenerator.scala @@ -13,6 +13,7 @@ import com.github.unchama.seichiassist.subsystems.ranking.domain.{ Ranking, RankingRecordWithPosition } +import com.github.unchama.seichiassist.subsystems.vote.VoteAPI import com.github.unchama.seichiassist.util.TypeConverter import org.bukkit.Bukkit import org.bukkit.ChatColor._ @@ -25,7 +26,8 @@ class PlayerStatsLoreGenerator( playerData: PlayerData, seichiRanking: Ranking[SeichiAmountData], seichiAmountData: SeichiAmountData, - expBarVisibility: BreakCountBarVisibility + expBarVisibility: BreakCountBarVisibility, + voteAPI: VoteAPI[IO, Player] ) { private val targetPlayer: Player = Bukkit.getPlayer(playerData.uuid) @@ -167,11 +169,15 @@ class PlayerStatsLoreGenerator( /** * 連続投票日数の説明文. */ - private def totalChainVoteDaysDescription(): List[String] = - if (playerData.ChainVote > 0) - List(s"$RESET${GRAY}連続投票日数:${playerData.ChainVote}日") + private def totalChainVoteDaysDescription(): List[String] = { + val consecutiveVoteStreakDays = + voteAPI.currentConsecutiveVoteStreakDays(targetPlayer.getUniqueId).unsafeRunSync().value + + if (consecutiveVoteStreakDays > 0) + List(s"$RESET${GRAY}連続投票日数:${consecutiveVoteStreakDays}日") else Nil + } /** * Expバーの説明文. diff --git a/src/main/scala/com/github/unchama/seichiassist/data/player/PlayerData.scala b/src/main/scala/com/github/unchama/seichiassist/data/player/PlayerData.scala index 45dc3fd9e5..89299af394 100644 --- a/src/main/scala/com/github/unchama/seichiassist/data/player/PlayerData.scala +++ b/src/main/scala/com/github/unchama/seichiassist/data/player/PlayerData.scala @@ -85,7 +85,6 @@ class PlayerData(@Deprecated() val uuid: UUID, val name: String) { var loginStatus: LoginStatus = LoginStatus(null) // 期間限定ログイン用 var LimitedLoginCount = 0 - var ChainVote = 0 // region スキル関連のデータ val skillState: Ref[IO, PlayerSkillState] = Ref.unsafe(PlayerSkillState.initial) diff --git a/src/main/scala/com/github/unchama/seichiassist/task/PlayerDataLoading.scala b/src/main/scala/com/github/unchama/seichiassist/task/PlayerDataLoading.scala index 89fcde5729..ef1eac42e8 100644 --- a/src/main/scala/com/github/unchama/seichiassist/task/PlayerDataLoading.scala +++ b/src/main/scala/com/github/unchama/seichiassist/task/PlayerDataLoading.scala @@ -251,8 +251,6 @@ object PlayerDataLoading { playerData.lastcheckdate = sdf.format(cal.getTime) - playerData.ChainVote = rs.getInt("chainvote") - // 実績解除フラグのBitSet型への復元処理 // 初回nullエラー回避のための分岐 try {