diff options
author | saga <45262877+saga-00@users.noreply.github.com> | 2024-05-28 18:32:39 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-28 23:32:39 +0200 |
commit | e6785c803b22a8595234bf4b07da40ddaedbec96 (patch) | |
tree | 2389a1f387f0532d9c56c32613c943c59e94a43b | |
parent | 594164c67105eb6f03f92e31697d233a5b679f39 (diff) | |
download | skyhanni-e6785c803b22a8595234bf4b07da40ddaedbec96.tar.gz skyhanni-e6785c803b22a8595234bf4b07da40ddaedbec96.tar.bz2 skyhanni-e6785c803b22a8595234bf4b07da40ddaedbec96.zip |
Improvement: Teleport to Infested plot defaults to Warp Garden (#1910)
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/garden/pests/PestFinderConfig.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt | 3 |
2 files changed, 8 insertions, 0 deletions
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 } |