aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2024-10-23 00:08:13 -0500
committerGitHub <noreply@github.com>2024-10-23 00:08:13 -0500
commit40e4096d2435533eacb817ad5a5e12c7ced8fa5c (patch)
tree937c4024bb7f69b19b6d053e02a9e5b3b02d98aa /azalea-protocol/src/packets/game/clientbound_player_position_packet.rs
parentabc7b43b8c641b6dc4b107bb9624b86235bd36db (diff)
downloadazalea-drasl-40e4096d2435533eacb817ad5a5e12c7ced8fa5c.tar.xz
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
Diffstat (limited to 'azalea-protocol/src/packets/game/clientbound_player_position_packet.rs')
-rwxr-xr-xazalea-protocol/src/packets/game/clientbound_player_position_packet.rs14
1 files changed, 7 insertions, 7 deletions
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<Self, BufReadError> {
- 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),