diff options
| author | mat <git@matdoes.dev> | 2025-06-09 17:15:07 +0900 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-09 17:15:07 +0900 |
| commit | 4a4de819616d620d15680e71fb32390e28ab07cd (patch) | |
| tree | 9bd1159dec3527b07651d0d9c78f96c95d115e7b /azalea-entity/src/vec_delta_codec.rs | |
| parent | 45d73712746fbfd365e8a68a75dfad6ae2e0d174 (diff) | |
| download | azalea-drasl-4a4de819616d620d15680e71fb32390e28ab07cd.tar.xz | |
handle relative teleports correctly and fix entity chunk indexing warnings
Diffstat (limited to 'azalea-entity/src/vec_delta_codec.rs')
| -rw-r--r-- | azalea-entity/src/vec_delta_codec.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |
