From eda44cb8743c709c15a7ed03381d05e43728e647 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Thu, 19 Dec 2024 20:18:39 +0100 Subject: feat: Add corpse loot detection --- .../moe/nea/ledger/modules/VisitorDetection.kt | 24 +--------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt') diff --git a/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt b/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt index 2ee581c..f457ae4 100644 --- a/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt +++ b/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt @@ -59,29 +59,7 @@ class VisitorDetection { private fun parseGardenLoreLine(rewardLine: String): Pair? { val f = rewardLine.unformattedString().trim() - return parseSpecialReward(f) - ?: idProvider.findStackableItemByName(f, true) - } - - private val specialRewardRegex = "\\+(?${SHORT_NUMBER_PATTERN})x? (?.*)".toPattern() - - private fun parseSpecialReward(specialLine: String): Pair? { - specialRewardRegex.useMatcher(specialLine) { - val id = when (group("what")) { - "Copper" -> ItemId.COPPER - "Bits" -> ItemId.BITS - "Garden Experience" -> ItemId.GARDEN - "Farming XP" -> ItemId.FARMING - "Gold Essence" -> ItemId.GOLD_ESSENCE - "Gemstone Powder" -> ItemId.GEMSTONE_POWDER - "Mithril Powder" -> ItemId.MITHRIL_POWDER - "Pelts" -> ItemId.PELT - "Fine Flour" -> ItemId.FINE_FLOUR - else -> ItemId.NIL - } - return Pair(id, parseShortNumber(group("amount"))) - } - return null + return idProvider.findStackableItemByName(f, true) } -- cgit