diff --git a/build.gradle.kts b/build.gradle.kts index ba67a12..37dd0f6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -62,7 +62,6 @@ subprojects { implementation("$kotlinX:kotlinx-serialization-core:$serializationVer") implementation("$kotlinX:kotlinx-serialization-json:$serializationVer") listOf( - "$kotlinX:kotlinx-datetime-jvm:0.2.1", "com.typesafe:config:1.4.1", "io.github.config4k:config4k:0.4.2", "com.github.Vatuu:discord-rpc:1.6.2" @@ -79,7 +78,6 @@ subprojects { } withType(ShadowJar::class) { this.configurations = listOf(shadowC) - relocate("kotlinx.datetime", "${rootProject.group}.datetime") relocate("javassist", "${rootProject.group}.javassist") relocate("org.reflections8", "${rootProject.group}.reflectionlib") relocate("com.typesafe.config", "${rootProject.group}.typesafe.config") diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Clock.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Clock.kt index f7729c2..aa0f995 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Clock.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Clock.kt @@ -3,14 +3,11 @@ package fr.username404.snowygui.gui.feature import com.mojang.blaze3d.vertex.PoseStack import fr.username404.snowygui.Snowy.Companion.onEvent import fr.username404.snowygui.gui.FontUtil -import kotlinx.datetime.Clock as DatetimeClock -import kotlinx.datetime.TimeZone -import kotlinx.datetime.toLocalDateTime +import java.time.LocalDateTime @ButtonInfo(Category.MISC) object Clock: ButtonImpl() { - private val currentTimezone = TimeZone.currentSystemDefault() - override fun toString(): String = DatetimeClock.System.now().toLocalDateTime(currentTimezone).run { + override fun toString(): String = LocalDateTime.now().run { arrayOf(hour, minute, second).map { (it.takeIf { (it >= 10) } ?: "0$it").toString() }.reduce { previous, current -> "$previous:$current"}