From 34e9edc6d74a82be1b7aff003e006ce1e5874e4f Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 7 Sep 2022 23:19:35 +0200 Subject: fixed best bazaar sell method with enchanted book --- .../at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt | 6 +++++- .../java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') 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