aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-22 01:22:11 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-22 01:22:11 +0100
commitacbc0df1de5e89a978b42d4dc4f123d52ddf0e82 (patch)
tree6ff74fff8b05a3494618c60ce62dc1bddf90356c /src/main/java/at/hannibal2/skyhanni/features
parent0102ddc4946b2e197024ef828c14f3b7b298dcd5 (diff)
downloadskyhanni-acbc0df1de5e89a978b42d4dc4f123d52ddf0e82.tar.gz
skyhanni-acbc0df1de5e89a978b42d4dc4f123d52ddf0e82.tar.bz2
skyhanni-acbc0df1de5e89a978b42d4dc4f123d52ddf0e82.zip
Hide "Not sprayed!" text while in barn or outside garden area.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayDisplay.kt12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayDisplay.kt
index c54e875ab..fa48a0518 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayDisplay.kt
@@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.features.garden.GardenPlotAPI
import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.currentSpray
+import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.isBarn
import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.isSprayExpired
import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.markExpiredSprayAsNotified
import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.name
@@ -27,11 +28,12 @@ class SprayDisplay {
if (!GardenAPI.inGarden() || !event.isMod(5)) return
if (config.displayEnabled) {
- val plot = GardenPlotAPI.getCurrentPlot() ?: return
- display = plot.currentSpray?.let {
- val timer = it.expiry.timeUntil()
- "§eSprayed with §a${it.type.displayName} §7- ${timer.timerColor("§b")}${timer.format()}"
- } ?: if (config.showNotSprayed) "§cNot sprayed!" else ""
+ display = GardenPlotAPI.getCurrentPlot()?.takeIf { !it.isBarn() }?.let { plot ->
+ plot.currentSpray?.let {
+ val timer = it.expiry.timeUntil()
+ "§eSprayed with §a${it.type.displayName} §7- ${timer.timerColor("§b")}${timer.format()}"
+ } ?: if (config.showNotSprayed) "§cNot sprayed!" else ""
+ } ?: ""
}
if (config.expiryNotification) {