diff options
| author | mat <github@matdoes.dev> | 2022-06-24 23:54:31 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-24 23:54:31 -0500 |
| commit | 41f61bf9c11ab58af4c1bd97c2cb40110b272449 (patch) | |
| tree | 3784907c2c18ce9881907a9e2603218d26fcf973 /azalea-client/src/movement.rs | |
| parent | b030b0ea330c674415f7e30634957167b2fa6a6d (diff) | |
| download | azalea-drasl-41f61bf9c11ab58af4c1bd97c2cb40110b272449.tar.xz | |
i hate mutexes
Diffstat (limited to 'azalea-client/src/movement.rs')
| -rw-r--r-- | azalea-client/src/movement.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/azalea-client/src/movement.rs b/azalea-client/src/movement.rs index 0402b15b..f74d48df 100644 --- a/azalea-client/src/movement.rs +++ b/azalea-client/src/movement.rs @@ -5,7 +5,9 @@ use azalea_protocol::packets::game::serverbound_move_player_packet_pos_rot::Serv impl Client { /// Set the client's position to the given coordinates. pub async fn move_to(&mut self, new_pos: EntityPos) -> Result<(), String> { + println!("obtaining lock on state"); let mut state_lock = self.state.lock().unwrap(); + println!("obtained lock on state"); let world = state_lock.world.as_ref().unwrap(); @@ -18,7 +20,9 @@ impl Client { let world = state_lock.world.as_mut().unwrap(); world.move_entity(player_id, new_pos)?; + drop(state_lock); + println!("obtaining lock on conn"); self.conn .lock() .await @@ -34,6 +38,7 @@ impl Client { .get(), ) .await; + println!("obtained lock on conn"); Ok(()) } |
