The new legislation comes in response to a row over how ethnic minority offenders should be sentenced.