Built in the mid-14th century at the instigation of Wartislaw IV, subsequently reconstructed several times