aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-02-05 22:12:09 +1100
committerGitHub <noreply@github.com>2024-02-05 12:12:09 +0100
commitefc0fc65f2fede6204fa1cd9d3918a2f5d37dd92 (patch)
tree06a0f3bd5f899d66160b071aaf842ba75bec57e2 /src/main/java/at/hannibal2
parent146c0be91b210895105319b3d6727aa5a184e547 (diff)
downloadskyhanni-efc0fc65f2fede6204fa1cd9d3918a2f5d37dd92.tar.gz
skyhanni-efc0fc65f2fede6204fa1cd9d3918a2f5d37dd92.tar.bz2
skyhanni-efc0fc65f2fede6204fa1cd9d3918a2f5d37dd92.zip
check for in garden (#972)
Fixing Anita and Jacob workaround working outside garden. #972
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt
index f42560100..5fe8f1dd0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt
@@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.InventoryOpenEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.garden.visitor.VisitorOpenEvent
+import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.EntityUtils
import at.hannibal2.skyhanni.utils.LocationUtils.distanceTo
@@ -29,6 +30,7 @@ object NPCVisitorFix {
@SubscribeEvent
fun onInventoryOpen(event: InventoryOpenEvent) {
+ if (!GardenAPI.inGarden()) return
val name = staticVisitors.firstOrNull { event.inventoryName.contains(it) } ?: return
val nearest = findNametags(name).firstOrNull { it.distanceToPlayer() < 3 } ?: return
DelayedRun.runDelayed(200.milliseconds) {