Following the outbreak of World War I in 1914, lifetime in Munich became extremely hard, as the Allied blockade of Germany led to foodstuff and gas shortages. In 1623, all through the Thirty Years' War, Munich became an electoral residence when Maximilian I, Duke of Bavaria was invested with the electoral dignity, but in 1632 the town was occupied by Gustav II Adolph of Sweden.