mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
remove .unwrap()
from wait_until_goto_target_reached
(#216)
* fix panics in `wait_until_goto_target_reached` * replace eprintln with warn --------- Co-authored-by: mat <git@matdoes.dev>
This commit is contained in:
parent
77f9d929b6
commit
6c1b144970
1 changed files with 6 additions and 1 deletions
|
@ -40,6 +40,7 @@ use futures_lite::future;
|
|||
use goals::BlockPosGoal;
|
||||
use parking_lot::RwLock;
|
||||
use rel_block_pos::RelBlockPos;
|
||||
use tokio::sync::broadcast::error::RecvError;
|
||||
use tracing::{debug, error, info, trace, warn};
|
||||
|
||||
pub use self::debug::PathfinderDebugParticles;
|
||||
|
@ -253,7 +254,11 @@ impl PathfinderClientExt for azalea_client::Client {
|
|||
let mut tick_broadcaster = self.get_tick_broadcaster();
|
||||
while !self.is_goto_target_reached() {
|
||||
// check every tick
|
||||
tick_broadcaster.recv().await.unwrap();
|
||||
match tick_broadcaster.recv().await {
|
||||
Ok(_) => (),
|
||||
Err(RecvError::Closed) => return,
|
||||
Err(err) => warn!("{err}"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue