Exemple #1
0
 public override void Flush(NetworkStream ns)
 {
     MinecraftStream read = new MinecraftStream();
     read.WriteVarInt(KeepAliveID);
     var buf = read.Flush(ID);
     ns.Write(buf, 0, buf.Length);
 }
        public override void Flush(NetworkStream ns)
        {
            MinecraftStream read = new MinecraftStream();
            read.WriteDouble(X);
            read.WriteDouble(Y);
            read.WriteDouble(X);
            read.WriteFloat(Yaw);
            read.WriteFloat(Pitch);
            read.WriteByte(Flags);
            read.WriteVarInt(TeleportID);

            var buf = read.Flush(ID);
            ns.Write(buf, 0, buf.Length);
        }
Exemple #3
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();
        }