diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-12-28 04:31:29 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-28 04:31:29 -0600 |
| commit | 20c7e27250148f62bab9e7b99e4f0cd6deb82325 (patch) | |
| tree | 163b312ef4dc72c5c23be923f8ca17cdf2a7278c /azalea/src/bot.rs | |
| parent | 7ab3b8924f64f7eadb6b8928b6fae73cb06e4c2f (diff) | |
| download | azalea-drasl-20c7e27250148f62bab9e7b99e4f0cd6deb82325.tar.xz | |
Change Client::component to return a reference (#298)
* change Client::component to return a reference
* write docs
* merge main
* remove unused parking_lot feature
Diffstat (limited to 'azalea/src/bot.rs')
| -rw-r--r-- | azalea/src/bot.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs index 73b225b2..d3527938 100644 --- a/azalea/src/bot.rs +++ b/azalea/src/bot.rs @@ -82,7 +82,7 @@ fn stop_jumping(mut query: Query<(&mut Jumping, &mut Bot)>) { impl Client { /// Queue a jump for the next tick. pub fn jump(&self) { - let mut ecs = self.ecs.lock(); + let mut ecs = self.ecs.write(); ecs.write_message(JumpEvent { entity: self.entity, }); @@ -92,7 +92,7 @@ impl Client { /// /// To look at the center of a block, you should call [`BlockPos::center`]. pub fn look_at(&self, position: Vec3) { - let mut ecs = self.ecs.lock(); + let mut ecs = self.ecs.write(); ecs.write_message(LookAtEvent { entity: self.entity, position, @@ -136,7 +136,7 @@ impl Client { let mut receiver = self.get_tick_broadcaster(); while receiver.recv().await.is_ok() { - let ecs = self.ecs.lock(); + let ecs = self.ecs.read(); if ecs.get::<Mining>(self.entity).is_none() { break; } |
