From fd9bf168716f195e7e6225b93dfb099aa01b1fde Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 17 Jun 2025 09:30:09 +1200 Subject: implement EntityHitResult --- azalea-core/src/position.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'azalea-core/src/position.rs') diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index 5a8d3e0c..c0c25639 100644 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -350,6 +350,12 @@ impl Vec3 { z: self.z.ceil() as i32, } } + + /// Whether the distance between this point and `other` is less than + /// `range`. + pub fn closer_than(&self, other: Vec3, range: f64) -> bool { + self.distance_squared_to(other) < range.powi(2) + } } /// The coordinates of a block in the world. -- cgit v1.2.3