aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-26 17:05:40 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-26 17:05:40 +0100
commitf812ba2e0b6320ac21d477ba8e35d7cfc7accd4c (patch)
tree116e8abf335b5bdf9370a073d71d899ae9772824
parent9639b0927aabbc7f23e62a603e1ffee8832235f8 (diff)
downloadskyhanni-f812ba2e0b6320ac21d477ba8e35d7cfc7accd4c.tar.gz
skyhanni-f812ba2e0b6320ac21d477ba8e35d7cfc7accd4c.tar.bz2
skyhanni-f812ba2e0b6320ac21d477ba8e35d7cfc7accd4c.zip
Fixed Hide Not Clickable Items show in the garden visitor inventory.
-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()