aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-05-24 02:52:21 -0500
committermat <git@matdoes.dev>2023-05-24 02:52:21 -0500
commit8be3921ad450958ac9bc8c1911ecd65760ea42b6 (patch)
tree2bf05b45f2aaa23f3b1f54c1ef365888ee02f08a /azalea/src/pathfinder
parent630c78b3180443115b84261a63bfdb3e61c41822 (diff)
parenteb65b0ad6e03f5ffcf8f0f2328ec91bb7e26259f (diff)
downloadazalea-drasl-8be3921ad450958ac9bc8c1911ecd65760ea42b6.tar.xz
merge main
Diffstat (limited to 'azalea/src/pathfinder')
-rw-r--r--azalea/src/pathfinder/mod.rs7
-rw-r--r--azalea/src/pathfinder/moves.rs3
2 files changed, 9 insertions, 1 deletions
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index 3f978c95..b7ed222d 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -70,6 +70,13 @@ pub trait PathfinderClientExt {
}
impl PathfinderClientExt for azalea_client::Client {
+ /// ```
+ /// # use azalea::prelude::*;
+ /// # use azalea::{BlockPos, pathfinder::BlockPosGoal};
+ /// # fn example(bot: &Client) {
+ /// bot.goto(BlockPosGoal::from(BlockPos::new(0, 70, 0)));
+ /// # }
+ /// ```
fn goto(&self, goal: impl Goal + Send + Sync + 'static) {
self.ecs.lock().send_event(GotoEvent {
entity: self.entity,
diff --git a/azalea/src/pathfinder/moves.rs b/azalea/src/pathfinder/moves.rs
index 6625581d..0dca3c95 100644
--- a/azalea/src/pathfinder/moves.rs
+++ b/azalea/src/pathfinder/moves.rs
@@ -15,7 +15,8 @@ fn is_block_passable(pos: &BlockPos, world: &Instance) -> bool {
/// whether this block has a solid hitbox (i.e. we can stand on it)
fn is_block_solid(pos: &BlockPos, world: &Instance) -> bool {
if let Some(block) = world.chunks.get_block_state(pos) {
- block.shape() == &collision::block_shape()
+ // block.shape() == &collision::block_shape()
+ block.shape() != &collision::empty_shape()
} else {
false
}