diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-03-12 21:58:20 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-03-12 21:58:20 +0100 |
commit | b3b9f855f665158b8646095c011f1ae85e05c09a (patch) | |
tree | c6dbd6564e0874fdbb0070f4aefb8af3deb4c8b6 /src/main/java/at/hannibal2/skyhanni | |
parent | 72c46e7fc21011fb883c6e2bc34e6b5959898f44 (diff) | |
download | skyhanni-b3b9f855f665158b8646095c011f1ae85e05c09a.tar.gz skyhanni-b3b9f855f665158b8646095c011f1ae85e05c09a.tar.bz2 skyhanni-b3b9f855f665158b8646095c011f1ae85e05c09a.zip |
workaround for crash
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt index 0bf44d0a0..35220e27b 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.GardenPlotAPI import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.isBarn import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.name +import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraft.client.gui.FontRenderer @@ -25,6 +26,18 @@ fun drawString( * @return The replaced line, or null if it should be hidden */ fun tryToReplaceScoreboardLine(text: String): String? { + try { + return tryToReplaceScoreboardLineHarder(text) + } catch (t: Throwable) { + ErrorManager.logErrorWithData( + t, "Error while changing the scoreboard text.", + "text" to text + ) + return text + } +} + +private fun tryToReplaceScoreboardLineHarder(text: String): String? { if (SkyHanniMod.feature.misc.hideScoreboardNumbers && text.startsWith("§c") && text.length <= 4) { return null } |