···6677use crate::{types::packet::PacketBuilder, types::prefixed_array::PrefixedArray};
8899-// Used as the first ever packet sent for the TCP connection, to set the intent that the connection will use
99+/// Used as the first ever packet sent for the TCP connection, to set the intent that the connection will use
1010pub fn sb_handshake(intent: i32, stream: &mut TcpStream) {
1111 let packet = PacketBuilder::new(Some(0x00))
1212 .add_varint(772)
···1919 stream.flush().unwrap();
2020}
21212222-// Request server information ( Intent must be set to 1 when calling sb_handshake)
2222+/// Request server information ( Intent must be set to 1 when calling sb_handshake)
2323#[allow(dead_code)]
2424fn sb_status() {
2525 let mut stream = TcpStream::connect("127.0.0.1:25565").unwrap();
···3030 stream.flush().unwrap();
3131}
32323333-// Good to have for crash logs
3333+/// Good to have for crash logs
3434pub fn sb_client_brand(stream: &mut TcpStream) {
3535 let packet = PacketBuilder::new(Some(0x02))
3636 .add_string("minecraft:brand")
···4141 stream.flush().unwrap();
4242}
43434444-// Used to login into the minecraft server ( Intent must be set to 2 when calling sb_handshake
4444+/// Used to login into the minecraft server ( Intent must be set to 2 when calling sb_handshake
4545pub fn sb_login(stream: &mut TcpStream) {
4646 sb_handshake(2, stream);
4747···5959 stream.flush().unwrap();
6060}
61616262-// After receiving succesful login response from the server confirm that it has been received
6262+/// After receiving succesful login response from the server confirm that it has been received
6363pub fn sb_login_acknowledged(stream: &mut TcpStream) {
6464 let packet = PacketBuilder::new(Some(0x03)).build();
6565···6767 stream.flush().unwrap();
6868}
69697070-// After logging in we need to stay connected to the server while answering a keep alive hearbeats
7070+/// After logging in we need to stay connected to the server while answering a keep alive hearbeats
7171pub fn sb_keep_alive(stream: &mut TcpStream, buffer: Vec<u8>) {
7272 let mut packet = PacketBuilder::new(None).add_slice(&buffer).build();
7373···7575 stream.flush().unwrap();
7676}
77777878-// Declares player settings when they connect
7878+/// Declares player settings when they connect
7979pub fn sb_client_information(stream: &mut TcpStream) {
8080 let packet = PacketBuilder::new(Some(0x00))
8181 .add_string("en_us")
···9393 stream.flush().unwrap();
9494}
95959696-// Declares the known packs to the server ( Required for configuration to finalize)
9696+/// Declares the known packs to the server ( Required for configuration to finalize)
9797pub fn sb_known_packs(stream: &mut TcpStream) {
9898 let packet = PacketBuilder::new(Some(0x07))
9999 .add_slice(
···107107 stream.flush().unwrap();
108108}
109109110110-// Tells the server that the configuration confirmation has been received and we can proceed to the next state
110110+/// Tells the server that the configuration confirmation has been received and we can proceed to the next state
111111pub fn sb_acknowledge_finish_configuration(stream: &mut TcpStream) {
112112 let mut packet = PacketBuilder::new(Some(0x03)).build();
113113 stream.write_all(&mut packet).unwrap();