aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2025-01-16 21:53:02 +0100
committerLinnea Gräf <nea@nea.moe>2025-01-16 22:12:18 +0100
commit5daefca0b50e563152462f0ee1a963b8c98c33f0 (patch)
treeccddac89abb549e4bf80c962d12355da9368cff6
parent305178f5511bbf7b4499d7cf4142a067ab42e2fc (diff)
downloadLocalTransactionLedger-5daefca0b50e563152462f0ee1a963b8c98c33f0.tar.gz
LocalTransactionLedger-5daefca0b50e563152462f0ee1a963b8c98c33f0.tar.bz2
LocalTransactionLedger-5daefca0b50e563152462f0ee1a963b8c98c33f0.zip
feat: Gummy Polar Bear Detection
-rw-r--r--basetypes/src/main/kotlin/moe/nea/ledger/TransactionType.kt1
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/Ledger.kt2
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/GummyPolarBearDetection.kt34
3 files changed, 37 insertions, 0 deletions
diff --git a/basetypes/src/main/kotlin/moe/nea/ledger/TransactionType.kt b/basetypes/src/main/kotlin/moe/nea/ledger/TransactionType.kt
index 33c633d..8424893 100644
--- a/basetypes/src/main/kotlin/moe/nea/ledger/TransactionType.kt
+++ b/basetypes/src/main/kotlin/moe/nea/ledger/TransactionType.kt
@@ -24,6 +24,7 @@ enum class TransactionType {
FORGED,
GOD_POTION_DRANK,
GOD_POTION_MIXIN_DRANK,
+ GUMMY_POLAR_BEAR_ATE,
KAT_TIMESKIP,
KAT_UPGRADE,
KISMET_REROLL,
diff --git a/mod/src/main/kotlin/moe/nea/ledger/Ledger.kt b/mod/src/main/kotlin/moe/nea/ledger/Ledger.kt
index 043b83e..e0382a9 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/Ledger.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/Ledger.kt
@@ -29,6 +29,7 @@ import moe.nea.ledger.modules.ForgeDetection
import moe.nea.ledger.modules.GambleDetection
import moe.nea.ledger.modules.GodPotionDetection
import moe.nea.ledger.modules.GodPotionMixinDetection
+import moe.nea.ledger.modules.GummyPolarBearDetection
import moe.nea.ledger.modules.KatDetection
import moe.nea.ledger.modules.KuudraChestDetection
import moe.nea.ledger.modules.MineshaftCorpseDetection
@@ -141,6 +142,7 @@ class Ledger {
GambleDetection::class.java,
GodPotionDetection::class.java,
GodPotionMixinDetection::class.java,
+ GummyPolarBearDetection::class.java,
ItemIdProvider::class.java,
KatDetection::class.java,
KuudraChestDetection::class.java,
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/GummyPolarBearDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/GummyPolarBearDetection.kt
new file mode 100644
index 0000000..d69df83
--- /dev/null
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/GummyPolarBearDetection.kt
@@ -0,0 +1,34 @@
+package moe.nea.ledger.modules
+
+import moe.nea.ledger.ItemChange
+import moe.nea.ledger.LedgerEntry
+import moe.nea.ledger.LedgerLogger
+import moe.nea.ledger.TransactionType
+import moe.nea.ledger.events.ChatReceived
+import moe.nea.ledger.gen.ItemIds
+import moe.nea.ledger.useMatcher
+import moe.nea.ledger.utils.di.Inject
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class GummyPolarBearDetection {
+
+ val ateGummyPolarBear = "You ate a Re-heated Gummy Polar Bear!".toPattern()
+
+ @Inject
+ lateinit var logger: LedgerLogger
+
+ @SubscribeEvent
+ fun onChat(event: ChatReceived) {
+ ateGummyPolarBear.useMatcher(event.message) {
+ logger.logEntry(
+ LedgerEntry(
+ TransactionType.GUMMY_POLAR_BEAR_ATE,
+ event.timestamp,
+ listOf(
+ ItemChange.lose(ItemIds.REHEATED_GUMMY_POLAR_BEAR, 1)
+ )
+ )
+ )
+ }
+ }
+} \ No newline at end of file