diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-08-16 11:17:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-16 11:17:13 +0200 |
commit | d524fe113d707dd4c190215853bfba3a8569f18c (patch) | |
tree | 5bfe1e9075999a06489a5a22ae67ace7e6c63d9f /src/main/java/at | |
parent | 24cbfa2faaa6cef709d42f75c3d1d51f3368e8b2 (diff) | |
download | skyhanni-d524fe113d707dd4c190215853bfba3a8569f18c.tar.gz skyhanni-d524fe113d707dd4c190215853bfba3a8569f18c.tar.bz2 skyhanni-d524fe113d707dd4c190215853bfba3a8569f18c.zip |
Fix: Mining Crash workaround (#2354)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/hooks/BlockRendererDispatcherHook.kt | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/BlockRendererDispatcherHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/BlockRendererDispatcherHook.kt index 2d15d3cb7..f72d56739 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/BlockRendererDispatcherHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/BlockRendererDispatcherHook.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.features.mining.MiningCommissionsBlocksColor import at.hannibal2.skyhanni.features.mining.MiningCommissionsBlocksColor.CommissionBlock.Companion.onColor import at.hannibal2.skyhanni.features.mining.MiningCommissionsBlocksColor.replaceBlocksMapCache import at.hannibal2.skyhanni.features.mining.OreType.Companion.isOreType +import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.block.state.IBlockState import net.minecraft.client.renderer.BlockRendererDispatcher @@ -25,12 +26,16 @@ fun modifyGetModelFromBlockState( if (!LorenzUtils.inSkyBlock) return - if (MiningCommissionsBlocksColor.enabled && MiningCommissionsBlocksColor.active) { - returnState = replaceBlocksMapCache.getOrPut(state) { - MiningCommissionsBlocksColor.CommissionBlock.entries.firstOrNull { - state.isOreType(it.oreType) - }?.onColor(state) ?: state + try { + if (MiningCommissionsBlocksColor.enabled && MiningCommissionsBlocksColor.active) { + returnState = replaceBlocksMapCache.getOrPut(state) { + MiningCommissionsBlocksColor.CommissionBlock.entries.firstOrNull { + state.isOreType(it.oreType) + }?.onColor(state) ?: state + } } + } catch (e: Exception) { + ErrorManager.logErrorWithData(e, "Error in MiningCommissionsBlocksColor") } if (returnState !== state) { |