Beispiel #1
0
 public override void Flush(NetworkStream ns)
 {
     MinecraftStream Write = new MinecraftStream();
     Write.WriteLong(Payload);
     var buf = Write.Flush(ID);
     ns.Write(buf, 0, buf.Length);
 }
Beispiel #2
0
        public byte[] Write()
        {
            var stream = new MinecraftStream();
            stream.WriteByte((byte)BitsPerEntry);
            stream.WriteVarInt(States.Count);
            foreach (var state in States)
            {
                stream.WriteVarInt(state);
            }

            long[] data = Storage.GetData();
            stream.WriteVarInt(data.Length);

            foreach (var i in data)
            {
                stream.WriteLong(i);
            }

            for (int i = 0; i < (16 * 16 * 16) / 2; i++)
            {
                stream.WriteByte(255);
            }

            for (int i = 0; i < (16 * 16 * 16) / 2; i++)
            {
                stream.WriteByte(255);
            }

            return stream._buffer.ToArray();
        }