aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/ledger/BazaarDetection.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-02-15 18:41:10 +0100
committerLinnea Gräf <nea@nea.moe>2024-02-15 18:41:10 +0100
commit3e19b97b52fae7422f8b0654da9341bf8c2393cb (patch)
treedc4bf85f326342a154e78aff3d5b8fdd2c14024e /src/main/java/moe/nea/ledger/BazaarDetection.kt
parente5d2966e05fcaca533c09ab5ec5bfd825848be02 (diff)
downloadLocalTransactionLedger-3e19b97b52fae7422f8b0654da9341bf8c2393cb.tar.gz
LocalTransactionLedger-3e19b97b52fae7422f8b0654da9341bf8c2393cb.tar.bz2
LocalTransactionLedger-3e19b97b52fae7422f8b0654da9341bf8c2393cb.zip
Added item ids
Diffstat (limited to 'src/main/java/moe/nea/ledger/BazaarDetection.kt')
-rw-r--r--src/main/java/moe/nea/ledger/BazaarDetection.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/moe/nea/ledger/BazaarDetection.kt b/src/main/java/moe/nea/ledger/BazaarDetection.kt
index aa3aeba..9bcab30 100644
--- a/src/main/java/moe/nea/ledger/BazaarDetection.kt
+++ b/src/main/java/moe/nea/ledger/BazaarDetection.kt
@@ -3,7 +3,7 @@ package moe.nea.ledger
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.util.regex.Pattern
-class BazaarDetection(val ledger: LedgerLogger) {
+class BazaarDetection(val ledger: LedgerLogger, val ids: ItemIdProvider) {
val instaBuyPattern =
Pattern.compile("\\[Bazaar\\] Bought (?<count>[0-9]+)x (?<what>.*) for (?<coins>$SHORT_NUMBER_PATTERN) coins!")
@@ -19,7 +19,7 @@ class BazaarDetection(val ledger: LedgerLogger) {
"BAZAAR_BUY_INSTANT",
event.timestamp,
parseShortNumber(group("coins")),
- group("what"),
+ ids.findForName(group("what")),
group("count").toInt(),
)
)
@@ -30,7 +30,7 @@ class BazaarDetection(val ledger: LedgerLogger) {
"BAZAAR_SELL_INSTANT",
event.timestamp,
parseShortNumber(group("coins")),
- group("what"),
+ ids.findForName(group("what")),
group("count").toInt(),
)
)