diff options
| author | mat <github@matdoes.dev> | 2022-06-25 17:37:29 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-25 17:37:29 -0500 |
| commit | e8deda5d2e45eb634700614009cbcc5b35949e26 (patch) | |
| tree | dab321d33c66e20e8b558d9777550a3d27cd4b59 /azalea-protocol | |
| parent | 978880b756aa052226f77c21e8e9de9b40070152 (diff) | |
| download | azalea-drasl-e8deda5d2e45eb634700614009cbcc5b35949e26.tar.xz | |
clippo
Diffstat (limited to 'azalea-protocol')
| -rw-r--r-- | azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs | 9 | ||||
| -rwxr-xr-x | azalea-protocol/src/packets/mod.rs | 6 |
2 files changed, 6 insertions, 9 deletions
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 2f439cd5..cf405e98 100755 --- 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>), } |
