diff options
Diffstat (limited to 'mod/src/main/kotlin')
-rw-r--r-- | mod/src/main/kotlin/moe/nea/ledger/Ledger.kt | 2 | ||||
-rw-r--r-- | mod/src/main/kotlin/moe/nea/ledger/modules/GummyPolarBearDetection.kt | 34 |
2 files changed, 36 insertions, 0 deletions
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 |