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/client_impl/movement.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/client_impl/movement.rs')
| -rw-r--r-- | azalea/src/client_impl/movement.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea/src/client_impl/movement.rs b/azalea/src/client_impl/movement.rs index b47da9a7..a708e5f6 100644 --- a/azalea/src/client_impl/movement.rs +++ b/azalea/src/client_impl/movement.rs @@ -19,7 +19,7 @@ impl Client { /// Returns whether the player will try to jump next tick. pub fn jumping(&self) -> bool { - *self.component::<Jumping>() + **self.component::<Jumping>() } pub fn set_crouching(&self, crouching: bool) { @@ -49,7 +49,7 @@ impl Client { /// /// See [`Self::set_direction`] for more details. pub fn direction(&self) -> (f32, f32) { - let look_direction: LookDirection = self.component::<LookDirection>(); + let look_direction = *self.component::<LookDirection>(); (look_direction.y_rot(), look_direction.x_rot()) } @@ -71,7 +71,7 @@ impl Client { /// # } /// ``` pub fn walk(&self, direction: WalkDirection) { - let mut ecs = self.ecs.lock(); + let mut ecs = self.ecs.write(); ecs.write_message(StartWalkEvent { entity: self.entity, direction, @@ -95,7 +95,7 @@ impl Client { /// # } /// ``` pub fn sprint(&self, direction: SprintDirection) { - let mut ecs = self.ecs.lock(); + let mut ecs = self.ecs.write(); ecs.write_message(StartSprintEvent { entity: self.entity, direction, |
