aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2024-12-11 19:51:12 -0600
committerGitHub <noreply@github.com>2024-12-11 19:51:12 -0600
commite9136c9cbbf9010b8352127e129c1cd290f377bd (patch)
treedb83316a273153106dd3b343c9d6d4fce234d132 /azalea-protocol/src
parent23932003d98db0f5f976146aa9a11e5d04a74695 (diff)
downloadazalea-drasl-e9136c9cbbf9010b8352127e129c1cd290f377bd.tar.xz
Implement EntityPositionSync (#196)
* implement EntityPositionSync * fix EntityPositionSync setting the wrong vec_delta_codec and also move into a RelativeEntityUpdate
Diffstat (limited to 'azalea-protocol/src')
-rwxr-xr-xazalea-protocol/src/packets/game/c_entity_position_sync.rs11
-rwxr-xr-xazalea-protocol/src/packets/game/c_player_position.rs8
2 files changed, 8 insertions, 11 deletions
diff --git a/azalea-protocol/src/packets/game/c_entity_position_sync.rs b/azalea-protocol/src/packets/game/c_entity_position_sync.rs
index c5cde322..6347ec5e 100755
--- a/azalea-protocol/src/packets/game/c_entity_position_sync.rs
+++ b/azalea-protocol/src/packets/game/c_entity_position_sync.rs
@@ -1,7 +1,8 @@
use azalea_buf::AzBuf;
-use azalea_core::position::Vec3;
use azalea_protocol_macros::ClientboundGamePacket;
+use super::c_player_position::PositionMoveRotation;
+
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundEntityPositionSync {
#[var]
@@ -9,11 +10,3 @@ pub struct ClientboundEntityPositionSync {
pub values: PositionMoveRotation,
pub on_ground: bool,
}
-
-#[derive(AzBuf, Clone, Debug)]
-pub struct PositionMoveRotation {
- pub position: Vec3,
- pub delta_movement: Vec3,
- pub y_rot: f32,
- pub x_rot: f32,
-}
diff --git a/azalea-protocol/src/packets/game/c_player_position.rs b/azalea-protocol/src/packets/game/c_player_position.rs
index c6a2e3f9..8d19ce36 100755
--- a/azalea-protocol/src/packets/game/c_player_position.rs
+++ b/azalea-protocol/src/packets/game/c_player_position.rs
@@ -2,6 +2,7 @@ use std::io::{Cursor, Write};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError};
use azalea_core::{bitset::FixedBitSet, position::Vec3};
+use azalea_entity::LookDirection;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
@@ -18,9 +19,12 @@ pub struct ClientboundPlayerPosition {
pub struct PositionMoveRotation {
pub pos: Vec3,
/// The updated delta movement (velocity).
+ ///
+ /// This is unused when included in a [`ClientboundEntityPositionSync`].
+ ///
+ /// [`ClientboundEntityPositionSync`]: super::c_entity_position_sync::ClientboundEntityPositionSync
pub delta: Vec3,
- pub y_rot: f32,
- pub x_rot: f32,
+ pub look_direction: LookDirection,
}
#[derive(Debug, Clone)]