From 17c00e7ed2fee95819f49a421690d4382ee28cc1 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Sat, 27 Apr 2024 11:42:31 +0200 Subject: Fix: Super Craft GFS with Pet (#1553) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt | 2 +- src/main/java/at/hannibal2/skyhanni/utils/NEUInternalName.kt | 3 ++- src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt index 9a8a0ba9e..9d3f92104 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SuperCraftFeatures.kt @@ -23,7 +23,7 @@ class SuperCraftFeatures { fun onChat(event: LorenzChatEvent) { if (!config.superCraftGFS) return val (internalName, amount) = craftedPattern.matchMatcher(event.message) { - NEUInternalName.fromItemName(this.group("item")) to (this.group("amount")?.formatInt() ?: 1) + NEUInternalName.fromItemName(group("item")) to (group("amount")?.formatInt() ?: 1) } ?: return if (!SackAPI.sackListInternalNames.contains(internalName.asString())) return DelayedRun.runNextTick { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUInternalName.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUInternalName.kt index ab71a7e2e..b3605094a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUInternalName.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUInternalName.kt @@ -19,7 +19,8 @@ class NEUInternalName private constructor(private val internalName: String) { return map.getOrPut(internalName) { NEUInternalName(internalName) } } - fun fromItemNameOrNull(itemName: String): NEUInternalName? = ItemNameResolver.getInternalNameOrNull(itemName) + fun fromItemNameOrNull(itemName: String): NEUInternalName? = + ItemNameResolver.getInternalNameOrNull(itemName.removeSuffix(" Pet")) fun fromItemName(itemName: String): NEUInternalName = fromItemNameOrNull(itemName) ?: ErrorManager.skyHanniError( diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 7c11f03db..f379ea2f2 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -125,7 +125,8 @@ object NEUItems { for (rawInternalName in allNeuRepoItems().keys) { val name = manager.createItem(rawInternalName).displayName.removeColor().lowercase() val internalName = rawInternalName.asInternalName() - map[name] = internalName + val storedName = name.removePrefix("[lvl 1➡100] ") + map[storedName] = internalName allInternalNames.add(internalName) } return map -- cgit