diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-30 22:01:15 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-30 22:01:15 +0100 |
commit | 00aadb43fcf8d9557987f60f476a44f4b22a0c45 (patch) | |
tree | 5762122614144d247ec6a22126635f35200170d6 /src/main/kotlin/moe/nea/ledger/LedgerEntry.kt | |
parent | 1c0090ec301b87edebc29453287e585f88de2c4f (diff) | |
download | LocalTransactionLedger-00aadb43fcf8d9557987f60f476a44f4b22a0c45.tar.gz LocalTransactionLedger-00aadb43fcf8d9557987f60f476a44f4b22a0c45.tar.bz2 LocalTransactionLedger-00aadb43fcf8d9557987f60f476a44f4b22a0c45.zip |
refactor: Add more item ids
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/LedgerEntry.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/ledger/LedgerEntry.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/LedgerEntry.kt b/src/main/kotlin/moe/nea/ledger/LedgerEntry.kt index dec0727..ec5548f 100644 --- a/src/main/kotlin/moe/nea/ledger/LedgerEntry.kt +++ b/src/main/kotlin/moe/nea/ledger/LedgerEntry.kt @@ -1,6 +1,7 @@ package moe.nea.ledger import com.google.gson.JsonObject +import moe.nea.ledger.gen.ItemIds import java.time.Instant import java.util.UUID @@ -10,8 +11,8 @@ data class LedgerEntry( val items: List<ItemChange>, ) { fun intoJson(profileId: UUID?): JsonObject { - val coinAmount = items.find { it.itemId == ItemId.COINS || it.itemId == ItemId.BITS }?.count - val nonCoins = items.find { it.itemId != ItemId.COINS && it.itemId != ItemId.BITS } + val coinAmount = items.find { it.itemId == ItemId.COINS || it.itemId == ItemIds.SKYBLOCK_BIT }?.count + val nonCoins = items.find { it.itemId != ItemId.COINS && it.itemId != ItemIds.SKYBLOCK_BIT } return JsonObject().apply { addProperty("transactionType", transactionType.name) addProperty("timestamp", timestamp.toEpochMilli().toString()) |