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 --- .../moe/nea/firmament/gui/profileviewer/ProfileViewer.kt | 10 +++++----- .../kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/kotlin/moe/nea/firmament/gui/profileviewer') diff --git a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/ProfileViewer.kt b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/ProfileViewer.kt index e811663..ada7603 100644 --- a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/ProfileViewer.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/ProfileViewer.kt @@ -44,31 +44,31 @@ class ProfileViewer( companion object { suspend fun onCommand(source: FabricClientCommandSource, name: String) { - source.sendFeedback(Text.translatable("firmament.pv.lookingup", name)) + source.sendFeedback(Text.stringifiedTranslatable("firmament.pv.lookingup", name)) try { val uuid = Routes.getUUIDForPlayerName(name) if (uuid == null) { - source.sendError(Text.translatable("firmament.pv.noplayer", name)) + source.sendError(Text.stringifiedTranslatable("firmament.pv.noplayer", name)) return } val name = Routes.getPlayerNameForUUID(uuid) ?: name val names = mapOf(uuid to (name)) val data = Routes.getAccountData(uuid) if (data == null) { - source.sendError(Text.translatable("firmament.pv.noprofile", name)) + source.sendError(Text.stringifiedTranslatable("firmament.pv.noprofile", name)) return } val accountData = mapOf(data.uuid to data) val profiles = Routes.getProfiles(uuid) val profile = profiles?.profiles?.find { it.selected } if (profile == null) { - source.sendFeedback(Text.translatable("firmament.pv.noprofile", name)) + source.sendFeedback(Text.stringifiedTranslatable("firmament.pv.noprofile", name)) return } ScreenUtil.setScreenLater(CottonClientScreen(ProfileViewer(uuid, names, accountData, profile))) } catch (e: Exception) { Firmament.logger.error("Error loading profile data for $name", e) - source.sendError(Text.translatable("firmament.pv.badprofile", name, e.message)) + source.sendError(Text.stringifiedTranslatable("firmament.pv.badprofile", name, e.message)) } } } diff --git a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt index 197f560..76c88c2 100644 --- a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/SkillPage.kt @@ -49,7 +49,7 @@ object SkillPage : ProfilePage { ) { override fun addTooltip(tooltip: TooltipBuilder) { tooltip.add(Text.literal("$level/$maxLevel")) - tooltip.add(Text.translatable("firmament.pv.skills.total", FirmFormatters.formatCurrency(exp, 1))) + tooltip.add(Text.stringifiedTranslatable("firmament.pv.skills.total", FirmFormatters.formatCurrency(exp, 1))) } } } -- cgit