Attacking a warship in international waters run by a NATO member is a de facto declaration of war, with a very real risk of escalating into the 'nukes fall everyone dies' variety of war. The very best China could hope for would be crippling economic sanctions from half the world. China's government may be oppressive, but they aren't stupid.