diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-07-07 05:58:44 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-07 05:58:44 +0000 |
| commit | 31e5629ce1c8267802bbcb9d03b60a299d474e59 (patch) | |
| tree | 5968b48af9b0c30149e908b043966c41dda0a61d /azalea-protocol/src/packets | |
| parent | 27edd4f578e7b64fdaacefa26f691e2148707a8c (diff) | |
| parent | 37d854c799236650da3deb025d8b32693531a27f (diff) | |
| download | azalea-drasl-31e5629ce1c8267802bbcb9d03b60a299d474e59.tar.xz | |
Merge branch 'main' into 1.19.1
Diffstat (limited to 'azalea-protocol/src/packets')
4 files changed, 8 insertions, 12 deletions
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 ee3f21a2..0e680701 100755 --- a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs @@ -1,4 +1,3 @@ -use super::GamePacket; use azalea_buf::McBuf; use azalea_buf::McBufVarReadable; use azalea_buf::{McBufReadable, McBufWritable, Readable, Writable}; @@ -236,7 +235,7 @@ impl McBufReadable for BrigadierNodeStub { } impl McBufWritable for BrigadierNodeStub { - fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + fn write_into(&self, _buf: &mut impl Write) -> Result<(), std::io::Error> { todo!() } } diff --git a/azalea-protocol/src/packets/game/clientbound_level_particles_packet.rs b/azalea-protocol/src/packets/game/clientbound_level_particles_packet.rs index a9ce57ad..53975cca 100644 --- a/azalea-protocol/src/packets/game/clientbound_level_particles_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_level_particles_packet.rs @@ -51,7 +51,7 @@ impl McBufReadable for ClientboundLevelParticlesPacket { } impl McBufWritable for ClientboundLevelParticlesPacket { - fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + fn write_into(&self, _buf: &mut impl Write) -> Result<(), std::io::Error> { todo!(); } } diff --git a/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs b/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs index 60ebe26c..24f34f6e 100644 --- a/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs @@ -22,15 +22,12 @@ impl McBufReadable for BlockStateWithPosition { let data = u64::var_read_from(buf)?; let position_part = data & 4095; let state = (data >> 12) as u32; - let position = ChunkSectionBlockPos { + let pos = ChunkSectionBlockPos { x: (position_part >> 8 & 15) as u8, - y: (position_part >> 0 & 15) as u8, + y: (position_part & 15) as u8, z: (position_part >> 4 & 15) as u8, }; - Ok(BlockStateWithPosition { - pos: position, - state: state, - }) + Ok(BlockStateWithPosition { pos, state }) } } diff --git a/azalea-protocol/src/packets/mod.rs b/azalea-protocol/src/packets/mod.rs index 2233b39d..819e31a7 100644 --- a/azalea-protocol/src/packets/mod.rs +++ b/azalea-protocol/src/packets/mod.rs @@ -31,9 +31,9 @@ impl ConnectionProtocol { #[derive(Clone, Debug)] pub enum Packet { - Game(game::GamePacket), - Handshake(handshake::HandshakePacket), - Login(login::LoginPacket), + Game(Box<game::GamePacket>), + Handshake(Box<handshake::HandshakePacket>), + Login(Box<login::LoginPacket>), Status(Box<status::StatusPacket>), } |
