From 51fbbaaf6fc8afb5ac8e13c14ad1df31b95ab64b Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 26 May 2022 17:59:43 -0500 Subject: Compiles --- .../packets/game/clientbound_declare_commands_packet.rs | 16 ++++++++-------- .../src/packets/login/serverbound_key_packet.rs | 5 +---- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'azalea-protocol/src/packets') 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}; -- cgit v1.2.3