diff options
| author | mat <github@matdoes.dev> | 2022-05-26 17:59:43 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-05-26 17:59:43 -0500 |
| commit | 51fbbaaf6fc8afb5ac8e13c14ad1df31b95ab64b (patch) | |
| tree | bbafe46f44d530cc94ba320e7bbc8d2fc52fb9c3 /azalea-protocol | |
| parent | 0530c5757925c615d0529926b1550da05f0669d9 (diff) | |
| download | azalea-drasl-51fbbaaf6fc8afb5ac8e13c14ad1df31b95ab64b.tar.xz | |
Compiles
Diffstat (limited to 'azalea-protocol')
3 files changed, 10 insertions, 13 deletions
diff --git a/azalea-protocol/packet-macros/src/lib.rs b/azalea-protocol/packet-macros/src/lib.rs index ae0fea0c..927e783b 100755 --- a/azalea-protocol/packet-macros/src/lib.rs +++ b/azalea-protocol/packet-macros/src/lib.rs @@ -56,7 +56,7 @@ fn create_impl_mcbufreadable(ident: &Ident, data: &Data) -> proc_macro2::TokenSt } syn::Data::Enum(syn::DataEnum { variants, .. }) => { let mut match_contents = quote!(); - let mut variant_discrim: usize = 0; + let mut variant_discrim: u32 = 0; for variant in variants { let variant_name = &variant.ident; match &variant.discriminant.as_ref() { diff --git a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs index 01f633f4..5617b0c4 100755 --- a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs @@ -111,7 +111,7 @@ impl McBufWritable for BrigadierString { } } -#[derive(Debug, Clone, McBuf)] +#[derive(Debug, Clone, Copy, McBuf)] pub enum BrigadierParserType { Bool = 0, Double, @@ -236,13 +236,13 @@ impl McBufReadable for BrigadierParser { BrigadierParserType::String => { Ok(BrigadierParser::String(BrigadierString::read_into(buf)?)) } - BrigadierParserType::Entity { - single, - players_only, - } => Ok(BrigadierParser::Entity { - single, - players_only, - }), + BrigadierParserType::Entity => { + let flags = buf.read_byte()?; + Ok(BrigadierParser::Entity { + single: flags & 0x01 != 0, + players_only: flags & 0x02 != 0, + }) + } BrigadierParserType::GameProfile => Ok(BrigadierParser::GameProfile), BrigadierParserType::BlockPos => Ok(BrigadierParser::BlockPos), BrigadierParserType::ColumnPos => Ok(BrigadierParser::ColumnPos), diff --git a/azalea-protocol/src/packets/login/serverbound_key_packet.rs b/azalea-protocol/src/packets/login/serverbound_key_packet.rs index 2c970036..d57b122a 100644 --- a/azalea-protocol/src/packets/login/serverbound_key_packet.rs +++ b/azalea-protocol/src/packets/login/serverbound_key_packet.rs @@ -1,9 +1,6 @@ use azalea_crypto::SaltSignaturePair; use packet_macros::{LoginPacket, McBuf}; -use std::{ - hash::Hash, - io::{Read, Write}, -}; +use std::io::{Read, Write}; use crate::mc_buf::{McBufReadable, McBufWritable}; |
