diff options
Diffstat (limited to 'azalea')
| -rw-r--r-- | azalea/examples/testbot/main.rs | 4 | ||||
| -rw-r--r-- | azalea/src/pathfinder/mod.rs | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index 9a3bd4f8..baa078d7 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -5,7 +5,7 @@ //! - Run `cargo r --example testbot` //! - Commands are prefixed with `!` in chat. You can send them either in public //! chat or as a /msg. -//! - Some commands to try are `!goto`, `!killaura`, `!down`. Check the +//! - Some commands to try are `!goto`, `!killaura true`, `!down`. Check the //! `commands` directory to see all of them. #![feature(async_closure)] @@ -31,7 +31,7 @@ const ADDRESS: &str = "localhost"; /// Whether the bot should run /particle a ton of times to show where it's /// pathfinding to. You should only have this on if the bot has operator /// permissions, otherwise it'll just spam the server console unnecessarily. -const PATHFINDER_DEBUG_PARTICLES: bool = true; +const PATHFINDER_DEBUG_PARTICLES: bool = false; #[tokio::main] async fn main() { diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index 9fd769e6..360c4df5 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -208,9 +208,11 @@ fn goto_listener( let thread_pool = AsyncComputeTaskPool::get(); for event in events.read() { - let (mut pathfinder, executing_path, position, instance_name, inventory) = query - .get_mut(event.entity) - .expect("Called goto on an entity that's not in the world"); + let Ok((mut pathfinder, executing_path, position, instance_name, inventory)) = + query.get_mut(event.entity) + else { + continue; + }; if event.goal.success(BlockPos::from(position)) { // we're already at the goal, nothing to do |
