diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-17 13:11:40 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-17 13:11:40 +0200 |
commit | d144ade0173c4d5cdefae948f1f62d929cb56e55 (patch) | |
tree | ab28caec243366d5cf1f6a722d3fa1eb1cc46a9e | |
parent | 86777a6f592b7b9a97d6a1491296c044c8942104 (diff) | |
download | skyhanni-d144ade0173c4d5cdefae948f1f62d929cb56e55.tar.gz skyhanni-d144ade0173c4d5cdefae948f1f62d929cb56e55.tar.bz2 skyhanni-d144ade0173c4d5cdefae948f1f62d929cb56e55.zip |
fixed test error
4 files changed, 18 insertions, 17 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt index 24ccef545..028b0edbc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/InGameDateDisplay.kt @@ -4,8 +4,8 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.formatted import at.hannibal2.skyhanni.utils.RenderUtils.renderString +import at.hannibal2.skyhanni.utils.TimeUtils.formatted import io.github.moulberry.notenoughupdates.util.SkyBlockTime import net.minecraftforge.fml.common.eventhandler.SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt index d459200e0..7e0f7b310 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt @@ -18,11 +18,11 @@ import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.colorCodeToRarity -import at.hannibal2.skyhanni.utils.LorenzUtils.formatted import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TabListData.Companion.getTabList +import at.hannibal2.skyhanni.utils.TimeUtils.formatted import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay.getCurrentPet import io.github.moulberry.notenoughupdates.util.SkyBlockTime import net.minecraft.item.ItemStack diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index 355473c9e..d53dd4d1b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -108,21 +108,6 @@ object LorenzUtils { fun SimpleDateFormat.formatCurrentTime(): String = this.format(System.currentTimeMillis()) - fun SkyBlockTime.formatted(): String { - val hour = if (this.hour > 12) this.hour - 12 else this.hour - val timeOfDay = if (this.hour > 11) "pm" else "am" // hooray for 12-hour clocks - var minute = this.minute.toString() - if (minute.length != 2) { - minute = minute.padStart(2, '0') - } - - val month = SkyBlockTime.monthName(this.month) - val day = this.day - val daySuffix = SkyBlockTime.daySuffix(day) - val year = this.year - return "$month $day$daySuffix, Year $year $hour:${minute}$timeOfDay" // Early Winter 1st Year 300, 12:03pm - } - fun stripVanillaMessage(originalMessage: String): String { var message = originalMessage diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt index 3f78c7a3b..33a9bbe83 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import io.github.moulberry.notenoughupdates.util.SkyBlockTime import kotlin.time.Duration object TimeUtils { @@ -117,6 +118,21 @@ object TimeUtils { } }.toLong() } + + fun SkyBlockTime.formatted(): String { + val hour = if (this.hour > 12) this.hour - 12 else this.hour + val timeOfDay = if (this.hour > 11) "pm" else "am" // hooray for 12-hour clocks + var minute = this.minute.toString() + if (minute.length != 2) { + minute = minute.padStart(2, '0') + } + + val month = SkyBlockTime.monthName(this.month) + val day = this.day + val daySuffix = SkyBlockTime.daySuffix(day) + val year = this.year + return "$month $day$daySuffix, Year $year $hour:${minute}$timeOfDay" // Early Winter 1st Year 300, 12:03pm + } } private const val FACTOR_SECONDS = 1000L |