Thing is, that the Chinese view Korea as a tributary state, a country they have a kind of ambiguous claim to over-lordship, in exchange, they do business and protect the country from foreign invasion. So predictably, they would feel obligated to protect Korea at all costs.
As for the collapse of Kim Jong-Un and the rest of his dynasty, it’s iffy since they view him as a client king, in position by the amused tolerance of China, with the occasional push-back if Kim gets too aggressive. Now if the Japanese would attack NK, then of course, the Chinese might believe they are honor bound to defend NK, since NK is viewed as part of a whole Korea that would require their protection.
Throw in the fact that the Chinese hate the Japanese and then it would be a perfect diplomatic mixture for another world war.
China's current provinces were tributary states before they were incorporated into the empire. This kind of thing wasn't unique to China - the Romans had something similar, but the Chinese empire remains in control of these provinces, whereas the former Roman provinces are now over a dozen independent countries. The average Chinese *knows* that if the West hadn't ventured into the Orient, Mongolia, Burma, Vietnam, Laos, Cambodia and Korea would all be Chinese provinces today. And perhaps even all of Southeast Asia, in an arc running through the Philippines, Indonesia, Malaysia through Thailand. IMO, Chinese irredentism over the the South China Sea is just the tip of the iceberg.
Another way of putting it - Chinese irredentism is like an onion - peel away one layer, and there’s another one just below it.