aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-02-10 21:59:37 +0100
committerGitHub <noreply@github.com>2024-02-10 21:59:37 +0100
commit7336d09d4f7da51f3b781b19b881a9cda7182783 (patch)
treee6b1d77142179ecbb81fd0245a21f2c682f4339a /src/main/java/at/hannibal2/skyhanni/features
parent8b3e7017b810b68145e9364a7b10cecd3f386f49 (diff)
downloadskyhanni-7336d09d4f7da51f3b781b19b881a9cda7182783.tar.gz
skyhanni-7336d09d4f7da51f3b781b19b881a9cda7182783.tar.bz2
skyhanni-7336d09d4f7da51f3b781b19b881a9cda7182783.zip
Fixed shift click npc sell not working for menus with different sizes. #990
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt
index 5e6c8bf6b..fbdd047db 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt
@@ -15,7 +15,7 @@ object ShiftClickNPCSell {
private val config get() = SkyHanniMod.feature.inventory.shiftClickNPCSell
- private val sellSlot = 49
+ private val sellSlot = -4
private val lastLoreLineOfSellPattern by RepoPattern.pattern(
"inventory.npc.sell.lore",
"§7them to this Shop!|§eClick to buyback!"
@@ -29,7 +29,9 @@ object ShiftClickNPCSell {
@SubscribeEvent
fun onOpen(event: InventoryFullyOpenedEvent) {
if (!LorenzUtils.inSkyBlock) return
- inInventory = lastLoreLineOfSellPattern.matches(event.inventoryItems[sellSlot]?.getLore()?.lastOrNull())
+ val item = event.inventoryItems[event.inventoryItems.keys.last() + sellSlot]
+
+ inInventory = lastLoreLineOfSellPattern.matches(item?.getLore()?.lastOrNull())
}
@SubscribeEvent