aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/bazaar
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-28 10:56:32 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-28 10:56:32 +0100
commit453f1149eae2fa417529b8792061d58b7e98bf81 (patch)
treece9476b906d8eb0ef73d4ad46500a881eb2c5ac5 /src/main/java/at/hannibal2/skyhanni/features/bazaar
parent0751af712913dd75977edfd51104d39058b39b38 (diff)
downloadskyhanni-453f1149eae2fa417529b8792061d58b7e98bf81.tar.gz
skyhanni-453f1149eae2fa417529b8792061d58b7e98bf81.tar.bz2
skyhanni-453f1149eae2fa417529b8792061d58b7e98bf81.zip
Fixed hide non clickable items not working in some bazaar pages.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/bazaar')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
index 241d208a3..840253166 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
@@ -16,6 +16,7 @@ import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.OSUtils
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
+import at.hannibal2.skyhanni.utils.StringUtils.equalsIgnoreColor
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraft.client.gui.inventory.GuiChest
@@ -119,14 +120,9 @@ class BazaarApi {
}
private fun checkIfInBazaar(event: InventoryFullyOpenedEvent): Boolean {
- val returnItem = event.inventorySize - 5
- for ((slot, item) in event.inventoryItems) {
- if (slot == returnItem && item.name?.removeColor().let { it == "Go Back" }) {
- val lore = item.getLore()
- if (lore.getOrNull(0)?.removeColor().let { it == "To Bazaar" }) {
- return true
- }
- }
+ val items = event.inventorySize.let { listOf(it - 5, it - 6) }.mapNotNull { event.inventoryItems[it] }
+ if (items.any { it.name.equalsIgnoreColor("Go Back") && it.getLore().firstOrNull() == "§7To Bazaar" }) {
+ return true
}
if (event.inventoryName.startsWith("Bazaar ➜ ")) return true