The court said the company must cease discharging woody debris and sediment.