aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt14
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt2
2 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
index d43bac5b6..596e673db 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
@@ -26,13 +26,15 @@ class GardenVisitorFeatures {
private var nearby = false
private var tick = 0
+ companion object {
+ var inVisitorInventory = false
+ }
+
@SubscribeEvent
fun onChatPacket(event: InventoryOpenEvent) {
- if (!isEnabled()) return
- if (!SkyHanniMod.feature.garden.visitorNeedsDisplay &&
- !SkyHanniMod.feature.garden.visitorHighlightReady
- ) return
+ inVisitorInventory = false
+ if (!isEnabled()) return
val npcItem = event.inventory.items[13] ?: return
val lore = npcItem.getLore()
var isVisitor = false
@@ -46,6 +48,9 @@ class GardenVisitorFeatures {
val offerItem = event.inventory.items[29] ?: return
if (offerItem.name != "§aAccept Offer") return
+ inVisitorInventory = true
+
+ if (!SkyHanniMod.feature.garden.visitorNeedsDisplay && !SkyHanniMod.feature.garden.visitorHighlightReady) return
val visitor = Visitor(lastClickedNpc)
for (line in offerItem.getLore()) {
@@ -114,6 +119,7 @@ class GardenVisitorFeatures {
if (!nearby) return
if (!SkyHanniMod.feature.garden.visitorShowPrice) return
+ if (!inVisitorInventory) return
val name = event.itemStack.name ?: return
if (name != "§aAccept Offer") return
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
index 66cf289b7..8bc1ffe7e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
@@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.data.ItemRenderBackground.Companion.borderLine
import at.hannibal2.skyhanni.events.GuiContainerEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi
+import at.hannibal2.skyhanni.features.garden.GardenVisitorFeatures
import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName
import at.hannibal2.skyhanni.utils.ItemUtils.cleanName
@@ -307,6 +308,7 @@ class HideNotClickableItems {
private fun hideNpcSell(chestName: String, stack: ItemStack): Boolean {
if (!tradeNpcFilter.match(chestName)) return false
+ if (GardenVisitorFeatures.inVisitorInventory) return false
reverseColor = true
var name = stack.cleanName()