From e6785c803b22a8595234bf4b07da40ddaedbec96 Mon Sep 17 00:00:00 2001 From: saga <45262877+saga-00@users.noreply.github.com> Date: Tue, 28 May 2024 18:32:39 -0300 Subject: Improvement: Teleport to Infested plot defaults to Warp Garden (#1910) --- .../skyhanni/config/features/garden/pests/PestFinderConfig.java | 5 +++++ .../java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/pests/PestFinderConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/pests/PestFinderConfig.java index ae2819317..20f840084 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/pests/PestFinderConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/pests/PestFinderConfig.java @@ -87,4 +87,9 @@ public class PestFinderConfig { @ConfigOption(name = "Always Teleport", desc = "Allow teleporting with the Teleport Hotkey even when you're already in an infested plot.") @ConfigEditorBoolean public boolean alwaysTp = false; + + @Expose + @ConfigOption(name = "Back to Garden", desc = "Make the Teleport Hotkey warp you to Garden if you don't have any pests.") + @ConfigEditorBoolean + public boolean backToGarden = false; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt index d60ed737b..4656ef062 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt @@ -172,7 +172,10 @@ object PestFinder { if (!GardenAPI.inGarden()) { ChatUtils.userError("This command only works while on the Garden!") } + val plot = PestAPI.getNearestInfestedPlot() ?: run { + if (config.backToGarden) return HypixelCommands.warp("garden") + ChatUtils.userError("No infested plots detected to warp to!") return } -- cgit