Phase transition in diamond-structure crystals during hardness measurements