From f3b6288fed75eacede95627282cb9bfec73f0c9e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:55:32 +0200 Subject: Fix: paleontologist in fossil excavator (#1490) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../features/mining/fossilexcavator/FossilExcavatorAPI.kt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt index d2e50bd1c..aef3e865b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt @@ -101,10 +101,20 @@ object FossilExcavatorAPI { inLoot = false return } - - val pair = itemPattern.matchMatcher(message) { + var pair = itemPattern.matchMatcher(message) { + /** + * TODO fix the bug that readItemAmount produces two different outputs: + * §r§fEnchanted Book -> §fEnchanted + * §fEnchanted Book §r§8x -> §fEnchanted Book + * + * also maybe this is no bug, as enchanted book is no real item? + */ ItemUtils.readItemAmount(group("item")) } ?: return + // Workaround: If it is a enchanted book, we assume it is a paleontologist I book + if (pair.first.let { it == "§fEnchanted" || it == "§fEnchanted Book"}) { + pair = "Paleontologist I" to pair.second + } loot.add(pair) } } -- cgit