Skip to content

Commit

Permalink
Merge pull request #1832 from GiganticMinecraft/fix/#1777
Browse files Browse the repository at this point in the history
fix: 景品とガチャ景品の交換結果を通知するメッセージの中の個数表示を修正
  • Loading branch information
Lucky3028 authored Jan 15, 2023
2 parents 4c81734 + 52c091b commit 77c3a7f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.github.unchama.generic.ContextCoercion
import com.github.unchama.seichiassist.concurrent.PluginExecutionContexts.onMainThread
import com.github.unchama.seichiassist.subsystems.gachapoint.GachaPointApi
import com.github.unchama.seichiassist.subsystems.gachapoint.domain.gachapoint.GachaPoint
import com.github.unchama.seichiassist.subsystems.tradesystems.domain.TradeSuccessResult
import com.github.unchama.seichiassist.subsystems.tradesystems.subsystems.gachatrade.bukkit.traderules.BigOrRegular
import com.github.unchama.seichiassist.subsystems.tradesystems.subsystems.gachatrade.domain.{
GachaListProvider,
Expand Down Expand Up @@ -74,10 +75,11 @@ class GachaTradeListener[F[_]: ConcurrentEffect, G[_]: ContextCoercion[*[_], F]]
*/
val tradableItemStacks = tradedInformation.tradedSuccessResult
val bigItemStackAmounts = tradableItemStacks.collect {
case result if result.transactionInfo._1 == BigOrRegular.Big => result.amount
case TradeSuccessResult(_, _, (rarity, amount)) if rarity == BigOrRegular.Big => amount
}.sum
val regularItemStackAmounts = tradableItemStacks.collect {
case result if result.transactionInfo._1 == BigOrRegular.Regular => result.amount
case TradeSuccessResult(_, _, (rarity, amount)) if rarity == BigOrRegular.Regular =>
amount
}.sum

if (tradeAmount == 0) {
Expand Down

0 comments on commit 77c3a7f

Please sign in to comment.