use std::hash::Hash; use crate::mc_buf::Writable; use super::LoginPacket; #[derive(Hash, Clone, Debug)] pub struct ServerboundHelloPacket { pub username: String, } impl ServerboundHelloPacket { pub fn get(self) -> LoginPacket { LoginPacket::ServerboundHelloPacket(self) } pub fn write(&self, buf: &mut Vec) -> Result<(), std::io::Error> { buf.write_utf(&self.username).unwrap(); Ok(()) } pub async fn read( _buf: &mut T, ) -> Result { Err("ServerboundHelloPacket::read not implemented".to_string()) } }