internal void EndGeneration() { game.Gui.SetNewScreen(null); if (gen.Blocks == null) { game.Chat.Add("&cFailed to generate the map."); } else { game.World.SetNewMap(gen.Blocks, gen.Width, gen.Height, gen.Length); gen.Blocks = null; ResetPlayerPosition(); game.WorldEvents.RaiseOnNewMapLoaded(); gen.ApplyEnv(game.World); } gen = null; GC.Collect(); }