aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-09-07 23:19:35 +0200
committerLorenz <lo.scherf@gmail.com>2022-09-07 23:19:35 +0200
commit398890a8799645002662e5bf76a3383a09ee986b (patch)
treef9c5b2d9bf73bd0732fb425445dc73ac112fe8c3
parent1da026f59c7eb8e2035284577e1fb250a4dc9288 (diff)
downloadSkyHanni-398890a8799645002662e5bf76a3383a09ee986b.tar.gz
SkyHanni-398890a8799645002662e5bf76a3383a09ee986b.tar.bz2
SkyHanni-398890a8799645002662e5bf76a3383a09ee986b.zip
fixed best bazaar sell method with enchanted book
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt
index a8940028d..216855738 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.bazaar
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.GuiContainerEvent
+import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
@@ -48,7 +49,10 @@ class BazaarBestSellMethod {
if (slot.slotNumber == slot.slotIndex) continue
if (slot.stack == null) continue
val stack = slot.stack
- val displayName = stack.displayName
+ var displayName = stack.displayName
+ if (displayName.endsWith("Enchanted Book")) {
+ displayName = stack.getLore()[0]
+ }
if (BazaarApi.getCleanBazaarName(displayName) == name) {
having += stack.stackSize
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt
index 7318f1aa5..aea9a3981 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt
@@ -121,8 +121,8 @@ internal class BazaarDataGrabber(private var bazaarMap: MutableMap<String, Bazaa
itemNames[apiName] = itemName
itemName
} else {
- if (apiName.startsWith("ENCHANTMENT_ULTIMATE_")) {
- val enchantmentName = getEnchantmentRealName(apiName.split("_ULTIMATE_")[1])
+ if (apiName.startsWith("ENCHANTMENT_ULTIMATE_") && !apiName.contains("JERRY") && !apiName.contains("WISE")) {
+ val enchantmentName = getEnchantmentRealName(apiName.split("ENCHANTMENT_ULTIMATE_")[1])
itemNames[apiName] = enchantmentName
enchantmentName
} else if (apiName.startsWith("ENCHANTMENT_")) {