package at.hannibal2.skyhanni.mixins.hooks import at.hannibal2.skyhanni.features.mining.MiningCommissionsBlocksColor import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.block.state.IBlockState import net.minecraft.client.renderer.BlockRendererDispatcher import net.minecraft.client.resources.model.IBakedModel import net.minecraft.util.BlockPos import net.minecraft.world.IBlockAccess import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable // Taken and modified from Skytils @Suppress("UnusedParameter") fun modifyGetModelFromBlockState( blockRendererDispatcher: BlockRendererDispatcher, state: IBlockState?, worldIn: IBlockAccess, pos: BlockPos?, cir: CallbackInfoReturnable, ) { if (pos == null) return if (!LorenzUtils.inSkyBlock) return val returnState = MiningCommissionsBlocksColor.processState(state) if (returnState != state) { cir.returnValue = blockRendererDispatcher.blockModelShapes.getModelForState(returnState) } }