From c4077a9aa597ddec23f8d4649c07f6615d0ecfc2 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 6 Oct 2024 23:33:32 +0200 Subject: fixed serialized names not liking lazy --- .../at/hannibal2/skyhanni/data/jsonobjects/repo/RepoErrorData.kt | 4 ++-- src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/RepoErrorData.kt b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/RepoErrorData.kt index 3ec529db3..0fe893723 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/RepoErrorData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/RepoErrorData.kt @@ -13,6 +13,6 @@ data class RepoErrorData( @Expose @SerializedName("replace_message") var replaceMessage: String?, @Expose @SerializedName("affected_versions") var affectedVersions: List = listOf(), ) { - val messageExact by lazy { rawMessageExact ?: emptyList() } - val messageStartsWith by lazy { rawMessageStartsWith ?: emptyList() } + val messageExact get() = rawMessageExact ?: emptyList() + val messageStartsWith get() = rawMessageStartsWith ?: emptyList() } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt index 7fed3ad02..fecdb6cdd 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt @@ -171,9 +171,6 @@ object ErrorManager { private fun buildFinalMessage(message: String): String? { var finalMessage = message - if (finalMessage.last() !in ".?!") { - finalMessage += "§c." - } val rawMessage = message.removeColor() var hideError = false @@ -197,6 +194,9 @@ object ErrorManager { } } + if (finalMessage.last() !in ".?!") { + finalMessage += "§c." + } return if (hideError) null else finalMessage } -- cgit