aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder
diff options
context:
space:
mode:
Diffstat (limited to 'azalea/src/pathfinder')
-rw-r--r--azalea/src/pathfinder/mod.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index c577b8e3..e5d1912d 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -281,15 +281,16 @@ impl PathfinderClientExt for Client {
}
}
fn is_goto_target_reached(&self) -> bool {
- self.get_component::<Pathfinder>()
+ self.component::<Pathfinder>()
+ .ok()
.is_none_or(|p| p.goal.is_none() && !p.is_calculating)
}
fn is_executing_path(&self) -> bool {
- self.get_component::<ExecutingPath>().is_some()
+ self.component::<ExecutingPath>().is_ok()
}
fn is_calculating_path(&self) -> bool {
- self.get_component::<Pathfinder>()
- .is_some_and(|p| p.is_calculating)
+ self.component::<Pathfinder>()
+ .is_ok_and(|p| p.is_calculating)
}
}