aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xazalea-protocol/packet-macros/src/lib.rs2
-rwxr-xr-xazalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs16
-rw-r--r--azalea-protocol/src/packets/login/serverbound_key_packet.rs5
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};