diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-04-27 11:42:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-27 11:42:31 +0200 |
commit | 17c00e7ed2fee95819f49a421690d4382ee28cc1 (patch) | |
tree | 329815dfa66833bd94a6443c43ef93fd47c3fcca | |
parent | b1ca6d79a772f5cb6abb7aab8575b36705d75911 (diff) | |
download | skyhanni-17c00e7ed2fee95819f49a421690d4382ee28cc1.tar.gz skyhanni-17c00e7ed2fee95819f49a421690d4382ee28cc1.tar.bz2 skyhanni-17c00e7ed2fee95819f49a421690d4382ee28cc1.zip |
Fix: Super Craft GFS with Pet (#1553)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
3 files changed, 5 insertions, 3 deletions
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 |