mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
fmt
This commit is contained in:
parent
6553d9510d
commit
8e2e81651c
2 changed files with 5 additions and 4 deletions
|
@ -51,7 +51,7 @@ use azalea_protocol::{
|
||||||
serverbound_login_acknowledged_packet::ServerboundLoginAcknowledgedPacket,
|
serverbound_login_acknowledged_packet::ServerboundLoginAcknowledgedPacket,
|
||||||
ClientboundLoginPacket,
|
ClientboundLoginPacket,
|
||||||
},
|
},
|
||||||
ConnectionProtocol, ClientIntention, PROTOCOL_VERSION,
|
ClientIntention, ConnectionProtocol, PROTOCOL_VERSION,
|
||||||
},
|
},
|
||||||
resolver, ServerAddress,
|
resolver, ServerAddress,
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,7 +54,7 @@ where
|
||||||
pub enum ClientIntention {
|
pub enum ClientIntention {
|
||||||
Status = 1,
|
Status = 1,
|
||||||
Login = 2,
|
Login = 2,
|
||||||
Transfer = 3
|
Transfer = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<i32> for ClientIntention {
|
impl TryFrom<i32> for ClientIntention {
|
||||||
|
@ -82,7 +82,8 @@ impl From<ClientIntention> for ConnectionProtocol {
|
||||||
impl azalea_buf::McBufReadable for ClientIntention {
|
impl azalea_buf::McBufReadable for ClientIntention {
|
||||||
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
|
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
|
||||||
let id = i32::var_read_from(buf)?;
|
let id = i32::var_read_from(buf)?;
|
||||||
id.try_into().map_err(|_| BufReadError::UnexpectedEnumVariant { id })
|
id.try_into()
|
||||||
|
.map_err(|_| BufReadError::UnexpectedEnumVariant { id })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,4 +91,4 @@ impl McBufWritable for ClientIntention {
|
||||||
fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
|
fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
|
||||||
(*self as i32).var_write_into(buf)
|
(*self as i32).var_write_into(buf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue