diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-22 01:22:11 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-22 01:22:11 +0100 |
commit | acbc0df1de5e89a978b42d4dc4f123d52ddf0e82 (patch) | |
tree | 6ff74fff8b05a3494618c60ce62dc1bddf90356c | |
parent | 0102ddc4946b2e197024ef828c14f3b7b298dcd5 (diff) | |
download | skyhanni-acbc0df1de5e89a978b42d4dc4f123d52ddf0e82.tar.gz skyhanni-acbc0df1de5e89a978b42d4dc4f123d52ddf0e82.tar.bz2 skyhanni-acbc0df1de5e89a978b42d4dc4f123d52ddf0e82.zip |
Hide "Not sprayed!" text while in barn or outside garden area.
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayDisplay.kt | 12 |
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) { |