aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-05-06 03:36:16 -0100
committermat <git@matdoes.dev>2026-05-07 08:05:58 -1200
commit9ffd0e80bbb3feace231553d6539124585b03e3c (patch)
treead8df7d07df9f8f542e288c263d76b8ffd637416 /azalea/src/pathfinder
parent4d1f430408dc6854c1af5fb14b2641e293a9cf43 (diff)
downloadazalea-drasl-9ffd0e80bbb3feace231553d6539124585b03e3c.tar.xz
change panicking functions in Client and EntityRef to return an AzaleaResult instead
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)
}
}