public void GenerateMap(Player p, int width, int height, int length) { Level lvl = CountdownMapGen.Generate(width, height, length); Level cur = LevelInfo.FindExact("countdown"); if (cur != null) { LevelActions.Replace(cur, lvl); } else { LevelInfo.Add(lvl); } lvl.Save(); Map = lvl; const string format = "Generated map ({0}x{1}x{2}), sending you to it.."; p.Message(format, width, height, length); PlayerActions.ChangeMap(p, "countdown"); Position pos = Position.FromFeetBlockCoords(8, 23, 17); p.SendPos(Entities.SelfID, pos, p.Rot); }
public void GenerateMap(Player p, int width, int height, int length) { Level lvl = CountdownMapGen.Generate(width, height, length); Level cur = LevelInfo.FindExact("countdown"); if (cur != null) { LevelActions.Replace(cur, lvl); } else { LevelInfo.Add(lvl); } lvl.Save(); Map = lvl; const string format = "Generated map ({0}x{1}x{2}), sending you to it.."; p.Message(format, width, height, length); PlayerActions.ChangeMap(p, "countdown"); }