public override void Use(Player p, params string[] args) { if (args.Length != 0) { Help(p); return; } p.Teleport_Spawn(); //p.Teleport_Player(p.level.SpawnX, p.level.SpawnY, p.level.SpawnZ); /*byte[] bytes = new byte[41]; util.EndianBitConverter.Big.GetBytes(p.level.SpawnX).CopyTo(bytes, 0); util.EndianBitConverter.Big.GetBytes(p.Stance).CopyTo(bytes, 8); util.EndianBitConverter.Big.GetBytes(p.level.SpawnY).CopyTo(bytes, 16); util.EndianBitConverter.Big.GetBytes(p.level.SpawnZ).CopyTo(bytes, 24); util.EndianBitConverter.Big.GetBytes(p.rot[0]).CopyTo(bytes, 32); util.EndianBitConverter.Big.GetBytes(p.rot[1]).CopyTo(bytes, 36); bytes[40] = p.onground; p.SendRaw(0x0D, bytes);*/ }
public override void Use(Player p, params string[] args) { if (args.Length < 1) Help(p); string level = args[0].ToLower(); if (World.Find(level) != null && p.level.name.ToLower() != level) { Player.players.ForEach(delegate(Player p1) { if (p1.level == p.level) p1.SendDespawn(p.id); p.SendDespawn(p1.id); }); foreach (Chunk c in p.level.chunkData.Values) { p.SendPreChunk(c, 0); } p.level = World.Find(level); p.Teleport_Spawn(); foreach (Chunk c in p.level.chunkData.Values) { p.SendPreChunk(c, 1); System.Threading.Thread.Sleep(10); p.SendChunk(c); c.RecalculateLight(); } p.VisibleChunks.Clear(); p.UpdateChunks(true, true); return; } p.SendMessage("GOTO FAILED"); }