From 831ef83a74384f7bc89a469b8aa621df5a271e0a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 1 Jun 2024 13:32:14 +0200 Subject: using buildString --- .../at/hannibal2/skyhanni/features/gui/BeaconPower.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt index 364a55d73..60ed3ed66 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt @@ -108,15 +108,16 @@ object BeaconPower { display = drawDisplay() } - private fun drawDisplay(): String { - var text = "§eBeacon: " - if (expiryTime.isInPast()) text += "§cNot active" - else { - text += "§b${expiryTime.timeUntil().format(maxUnits = 2)}" - if (config.beaconPowerStat) text += " §7(" + (stat ?: "§cNo stat") + "§7)" + private fun drawDisplay(): String = buildString { + append("§eBeacon: ") + if (expiryTime.isInPast()) { + append("§cNot active") + } else { + append("§b${expiryTime.timeUntil().format(maxUnits = 2)}") + if (config.beaconPowerStat) append(" §7(${stat ?: "§cNo stat"}§7)") } - return text } + private fun isEnabled() = LorenzUtils.inSkyBlock && config.beaconPower } -- cgit