diff options
| author | mat <git@matdoes.dev> | 2024-01-08 00:12:54 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-01-08 00:12:54 -0600 |
| commit | cfbfdd77b4a400ef3bace378ff413aa2ff3bf57c (patch) | |
| tree | 2d5fc56e4b2fbccb27b0a07c14002cf4c5eefaa0 /azalea | |
| parent | 0aa439d5caa8028b6d310de45258cbcef16ca2eb (diff) | |
| download | azalea-drasl-cfbfdd77b4a400ef3bace378ff413aa2ff3bf57c.tar.xz | |
fix ping packet, explosion packet, and panic less
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 |
