I'm under no pretensions that it could have been prevented entirely, but if you were a prince in Italy or the king of Hungary, could you have theoretically taken steps to mitigate it?
I've heard before that the handling of dead bodies contributed to the rapid spread, but I'm not sure how...