aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorsaga <45262877+saga-00@users.noreply.github.com>2024-05-28 18:32:39 -0300
committerGitHub <noreply@github.com>2024-05-28 23:32:39 +0200
commite6785c803b22a8595234bf4b07da40ddaedbec96 (patch)
tree2389a1f387f0532d9c56c32613c943c59e94a43b /src/main/java/at/hannibal2/skyhanni
parent594164c67105eb6f03f92e31697d233a5b679f39 (diff)
downloadskyhanni-e6785c803b22a8595234bf4b07da40ddaedbec96.tar.gz
skyhanni-e6785c803b22a8595234bf4b07da40ddaedbec96.tar.bz2
skyhanni-e6785c803b22a8595234bf4b07da40ddaedbec96.zip
Improvement: Teleport to Infested plot defaults to Warp Garden (#1910)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/pests/PestFinderConfig.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt3
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
}