From e9136c9cbbf9010b8352127e129c1cd290f377bd Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:51:12 -0600 Subject: Implement EntityPositionSync (#196) * implement EntityPositionSync * fix EntityPositionSync setting the wrong vec_delta_codec and also move into a RelativeEntityUpdate --- azalea-core/src/position.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'azalea-core/src') diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index 9b800e28..14ecfcc1 100755 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -20,7 +20,7 @@ macro_rules! vec3_impl { ($name:ident, $type:ty) => { impl $name { #[inline] - pub fn new(x: $type, y: $type, z: $type) -> Self { + pub const fn new(x: $type, y: $type, z: $type) -> Self { Self { x, y, z } } @@ -223,6 +223,8 @@ pub struct Vec3 { vec3_impl!(Vec3, f64); impl Vec3 { + pub const ZERO: Vec3 = Vec3::new(0.0, 0.0, 0.0); + /// Get the distance of this vector to the origin by doing /// `sqrt(x^2 + y^2 + z^2)`. pub fn length(&self) -> f64 { -- cgit v1.2.3