aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/inventory/TimerInLore.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-11-17 19:55:02 +0100
committerLinnea Gräf <nea@nea.moe>2025-11-17 19:55:02 +0100
commitc93a04a001b0f66b2724d46b04b6d1ed49a08d07 (patch)
tree5869ca70acc482ef0362f27785c3d3f1cbb9ffae /src/main/kotlin/features/inventory/TimerInLore.kt
parentaf9893b59407c69d31ebd2ed513f0396ab4d2dc9 (diff)
downloadFirmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.tar.gz
Firmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.tar.bz2
Firmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.zip
refactor: port to mojmaps
Diffstat (limited to 'src/main/kotlin/features/inventory/TimerInLore.kt')
-rw-r--r--src/main/kotlin/features/inventory/TimerInLore.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/kotlin/features/inventory/TimerInLore.kt b/src/main/kotlin/features/inventory/TimerInLore.kt
index d8eebda..9bb78c9 100644
--- a/src/main/kotlin/features/inventory/TimerInLore.kt
+++ b/src/main/kotlin/features/inventory/TimerInLore.kt
@@ -7,8 +7,8 @@ import java.time.format.DateTimeFormatterBuilder
import java.time.format.FormatStyle
import java.time.format.TextStyle
import java.time.temporal.ChronoField
-import net.minecraft.text.Text
-import net.minecraft.util.StringIdentifiable
+import net.minecraft.network.chat.Component
+import net.minecraft.util.StringRepresentable
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.events.ItemTooltipEvent
import moe.nea.firmament.util.SBData
@@ -29,7 +29,7 @@ object TimerInLore {
val timerFormat by choice("format") { TimerFormat.SOCIALIST }
}
- enum class TimerFormat(val formatter: DateTimeFormatter) : StringIdentifiable {
+ enum class TimerFormat(val formatter: DateTimeFormatter) : StringRepresentable {
RFC(DateTimeFormatter.RFC_1123_DATE_TIME),
LOCAL(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM)),
SOCIALIST(
@@ -57,7 +57,7 @@ object TimerInLore {
constructor(format: String) : this(DateTimeFormatter.ofPattern(format))
- override fun asString(): String {
+ override fun getSerializedName(): String {
return name
}
}
@@ -142,9 +142,9 @@ object TimerInLore {
// TODO: install approximate time stabilization algorithm
event.lines.add(
i + 1,
- Text.literal("${countdownType.label}: ")
+ Component.literal("${countdownType.label}: ")
.grey()
- .append(Text.literal(TConfig.timerFormat.formatter.format(localTimer)).aqua())
+ .append(Component.literal(TConfig.timerFormat.formatter.format(localTimer)).aqua())
)
}
}