From 40e4096d2435533eacb817ad5a5e12c7ced8fa5c Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Wed, 23 Oct 2024 00:08:13 -0500 Subject: 1.21.2 (#171) * partially implement 24w35a * start updating to 24w39a + itemcomponent codegen * fix codegen and broken packets to finish updating to 24w39a :D * update to 1.21.2 except for blocks * update ServerboundPlayerInputPacket impl --- .../src/packets/game/clientbound_player_position_packet.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'azalea-protocol/src/packets/game/clientbound_player_position_packet.rs') diff --git a/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs index d63108da..2a9cebc6 100755 --- a/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs @@ -1,19 +1,18 @@ use std::io::{Cursor, Write}; use azalea_buf::{BufReadError, McBuf, McBufReadable, McBufWritable}; -use azalea_core::bitset::FixedBitSet; +use azalea_core::{bitset::FixedBitSet, position::Vec3}; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundPlayerPositionPacket { - pub x: f64, - pub y: f64, - pub z: f64, + #[var] + pub id: u32, + pub pos: Vec3, + pub delta_movement: Vec3, pub y_rot: f32, pub x_rot: f32, pub relative_arguments: RelativeMovements, - #[var] - pub id: u32, } #[derive(Debug, Clone)] @@ -27,7 +26,8 @@ pub struct RelativeMovements { impl McBufReadable for RelativeMovements { fn read_from(buf: &mut Cursor<&[u8]>) -> Result { - let set = FixedBitSet::<5>::read_from(buf)?; + // yes minecraft seriously wastes that many bits, smh + let set = FixedBitSet::<32>::read_from(buf)?; Ok(RelativeMovements { x: set.index(0), y: set.index(1), -- cgit v1.2.3