From efbef712130048e1bf39e66b15271bf663586eee Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Fri, 9 Feb 2024 12:00:50 +0100 Subject: Fix crash when rendering SkyBlock id in a string --- src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt | 3 +++ src/main/kotlin/moe/nea/firmament/util/WarpUtil.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/moe/nea/firmament/util') diff --git a/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt b/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt index a071107..37a1f0c 100644 --- a/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt +++ b/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt @@ -30,6 +30,9 @@ import moe.nea.firmament.util.json.DashlessUUIDSerializer @Serializable value class SkyblockId(val neuItem: String) { val identifier get() = Identifier("skyblockitem", neuItem.lowercase().replace(";", "__").replace(":", "___")) + override fun toString(): String { + return neuItem + } /** * A bazaar stock item id, as returned by the HyPixel bazaar api endpoint. diff --git a/src/main/kotlin/moe/nea/firmament/util/WarpUtil.kt b/src/main/kotlin/moe/nea/firmament/util/WarpUtil.kt index 25cfdb0..5a7911c 100644 --- a/src/main/kotlin/moe/nea/firmament/util/WarpUtil.kt +++ b/src/main/kotlin/moe/nea/firmament/util/WarpUtil.kt @@ -65,7 +65,7 @@ object WarpUtil { ) { DConfig.data?.excludedWarps?.add(lastAttemptedWarp) DConfig.markDirty() - MC.sendChat(Text.translatable("firmament.warp-util.mark-excluded", lastAttemptedWarp)) + MC.sendChat(Text.stringifiedTranslatable("firmament.warp-util.mark-excluded", lastAttemptedWarp)) lastWarpAttempt = TimeMark.farPast() } if (it.unformattedString == "You may now fast travel to") { -- cgit