From 2cdbdcaa27c812e569c7c1a13d83182446e7f18b Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 23 Jun 2022 21:31:19 -0500 Subject: move_entity_with_delta --- azalea-core/src/delta.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'azalea-core/src/delta.rs') diff --git a/azalea-core/src/delta.rs b/azalea-core/src/delta.rs index 339e52cd..41923ffb 100644 --- a/azalea-core/src/delta.rs +++ b/azalea-core/src/delta.rs @@ -20,10 +20,12 @@ impl PositionDelta { } impl EntityPos { - pub fn apply_delta(&mut self, delta: &PositionDelta) { + pub fn with_delta(&self, delta: &PositionDelta) -> EntityPos { let (x, y, z) = delta.float(); - self.x += x; - self.y += y; - self.z += z; + EntityPos { + x: self.x + x, + y: self.y + y, + z: self.z + z, + } } } -- cgit v1.2.3