diff options
-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) { |