aboutsummaryrefslogtreecommitdiff
path: root/azalea-core
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-23 21:31:19 -0500
committermat <github@matdoes.dev>2022-06-23 21:31:19 -0500
commit2cdbdcaa27c812e569c7c1a13d83182446e7f18b (patch)
treec4f2970d847ec411bf6e859bc1521e93bc8b3c81 /azalea-core
parent37c6618c16319a7f40fd2e165190407472598e84 (diff)
downloadazalea-drasl-2cdbdcaa27c812e569c7c1a13d83182446e7f18b.tar.xz
move_entity_with_delta
Diffstat (limited to 'azalea-core')
-rw-r--r--azalea-core/src/delta.rs10
-rwxr-xr-xazalea-core/src/resource_location.rs3
2 files changed, 8 insertions, 5 deletions
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,
+ }
}
}
diff --git a/azalea-core/src/resource_location.rs b/azalea-core/src/resource_location.rs
index 61ae8a20..acca0c58 100755
--- a/azalea-core/src/resource_location.rs
+++ b/azalea-core/src/resource_location.rs
@@ -93,7 +93,8 @@ mod tests {
let mut buf = Vec::new();
ResourceLocation::new("minecraft:dirt")
.unwrap()
- .write_into(&mut buf)?;
+ .write_into(&mut buf)
+ .unwrap();
let mut buf = Cursor::new(buf);