From 4a4de819616d620d15680e71fb32390e28ab07cd Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 9 Jun 2025 17:15:07 +0900 Subject: handle relative teleports correctly and fix entity chunk indexing warnings --- azalea-entity/src/vec_delta_codec.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'azalea-entity/src/vec_delta_codec.rs') diff --git a/azalea-entity/src/vec_delta_codec.rs b/azalea-entity/src/vec_delta_codec.rs index 51aa7cea..270daff2 100644 --- a/azalea-entity/src/vec_delta_codec.rs +++ b/azalea-entity/src/vec_delta_codec.rs @@ -1,4 +1,4 @@ -use azalea_core::position::Vec3; +use azalea_core::{delta::PositionDelta8, position::Vec3}; #[derive(Debug, Clone, Default)] pub struct VecDeltaCodec { @@ -10,7 +10,11 @@ impl VecDeltaCodec { Self { base } } - pub fn decode(&self, x: i64, y: i64, z: i64) -> Vec3 { + pub fn decode(&self, delta: &PositionDelta8) -> Vec3 { + let x = delta.xa as i64; + let y = delta.ya as i64; + let z = delta.za as i64; + if x == 0 && y == 0 && z == 0 { return self.base; } -- cgit v1.2.3