private void SendChunkDataTo(EndPoint ep, GenericMessage msg) { var chp = new ChunkPos((int)msg.ReadSignedInteger(), (int)msg.ReadSignedInteger()); var chunk = _world.GetChunk(chp); if (!chunk.HasData) { _world.LoadChunk(chp); } var raw = chunk.GetRaw(); var m = new GenericMessage(); m.WriteUnsignedInteger(1); m.WriteSignedInteger((uint)chp.x); m.WriteSignedInteger((uint)chp.z); var data = new byte[raw.Length]; Buffer.BlockCopy(raw, 0, data, 0, data.Length); m.WriteUnsignedInteger((uint)data.Length); m.WriteByteArray(data); _server.SendToAsync(ep, m); }