aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder/mod.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-10-07 11:06:30 +0700
committermat <git@matdoes.dev>2025-10-07 11:06:30 +0700
commit17416abd1bd1dfffafb8bb9c0407b6373631e483 (patch)
treeb474c4c682967a15bbc9cedf2c6cc7c87f4714ae /azalea/src/pathfinder/mod.rs
parent6585e552d47387746f45ac4bb0f0a32d6219aa91 (diff)
downloadazalea-drasl-17416abd1bd1dfffafb8bb9c0407b6373631e483.tar.xz
several pathfinder fixes
Diffstat (limited to 'azalea/src/pathfinder/mod.rs')
-rw-r--r--azalea/src/pathfinder/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index b91060d9..6d78b043 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -385,8 +385,13 @@ pub fn goto_listener(
}
}
+/// Convert a player position to a block position, used internally in the
+/// pathfinder.
+///
+/// This is almost the same as `BlockPos::from(position)`, except that non-full
+/// blocks are handled correctly.
#[inline]
-pub(crate) fn player_pos_to_block_pos(position: Vec3) -> BlockPos {
+pub fn player_pos_to_block_pos(position: Vec3) -> BlockPos {
// 0.5 to account for non-full blocks
BlockPos::from(position.up(0.5))
}