From 1bad17906dc6f5f1f65b48300404dec4c3b67043 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 1 Apr 2023 01:29:14 +0200 Subject: Fixed bug with visitors that want an item only one time --- src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 2 +- src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index 43799dc50..557950fbe 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -152,7 +152,7 @@ object ItemUtils { val itemName = matcher.group("name") if (!itemName.contains("ยง8x")) { val amount = matcher.group("amount")?.replace(",", "")?.toInt() ?: 1 - val pair = Pair(itemName, amount) + val pair = Pair(itemName.trim(), amount) itemAmountCache[input] = pair return pair } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 1ce7c9e22..563e8976e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -30,6 +30,9 @@ object NEUItems { if (internalName == "HAY_BALE") { internalName = "HAY_BLOCK" } + if (internalName == null) { + throw Error("getInternalName is null for '$itemName'") + } itemNameCache[itemName] = internalName return internalName } -- cgit