aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
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