From efc0fc65f2fede6204fa1cd9d3918a2f5d37dd92 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Mon, 5 Feb 2024 22:12:09 +1100 Subject: check for in garden (#972) Fixing Anita and Jacob workaround working outside garden. #972 --- .../java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/at') 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) { -- cgit