From 20c7e27250148f62bab9e7b99e4f0cd6deb82325 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sun, 28 Dec 2025 04:31:29 -0600 Subject: Change Client::component to return a reference (#298) * change Client::component to return a reference * write docs * merge main * remove unused parking_lot feature --- azalea/src/client_impl/movement.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'azalea/src/client_impl/movement.rs') 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::() + **self.component::() } 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::(); + let look_direction = *self.component::(); (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, -- cgit v1.2.3