aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins/movement.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-04-04 16:05:06 -0430
committermat <git@matdoes.dev>2025-04-04 16:05:06 -0430
commit5fd57fd630bea256639332f117848d6f1fcfd132 (patch)
tree83e21595e69e24b3b1e8790dc630b79cf14a1777 /azalea-client/src/plugins/movement.rs
parente99ae608b67ad3ff105666e619d04ca9385488e1 (diff)
downloadazalea-drasl-5fd57fd630bea256639332f117848d6f1fcfd132.tar.xz
don't require mut for functions in Client and add some more convenience functions
Diffstat (limited to 'azalea-client/src/plugins/movement.rs')
-rw-r--r--azalea-client/src/plugins/movement.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea-client/src/plugins/movement.rs b/azalea-client/src/plugins/movement.rs
index 54a46bcb..1a02fd21 100644
--- a/azalea-client/src/plugins/movement.rs
+++ b/azalea-client/src/plugins/movement.rs
@@ -86,7 +86,7 @@ impl Client {
///
/// If you're making a realistic client, calling this function every tick is
/// recommended.
- pub fn set_jumping(&mut self, jumping: bool) {
+ pub fn set_jumping(&self, jumping: bool) {
let mut ecs = self.ecs.lock();
let mut jumping_mut = self.query::<&mut Jumping>(&mut ecs);
**jumping_mut = jumping;
@@ -101,7 +101,7 @@ impl Client {
/// side), `x_rot` is pitch (looking up and down). You can get these
/// numbers from the vanilla f3 screen.
/// `y_rot` goes from -180 to 180, and `x_rot` goes from -90 to 90.
- pub fn set_direction(&mut self, y_rot: f32, x_rot: f32) {
+ pub fn set_direction(&self, y_rot: f32, x_rot: f32) {
let mut ecs = self.ecs.lock();
let mut look_direction = self.query::<&mut LookDirection>(&mut ecs);
@@ -406,7 +406,7 @@ impl Client {
/// bot.walk(WalkDirection::None);
/// # }
/// ```
- pub fn walk(&mut self, direction: WalkDirection) {
+ pub fn walk(&self, direction: WalkDirection) {
let mut ecs = self.ecs.lock();
ecs.send_event(StartWalkEvent {
entity: self.entity,
@@ -429,7 +429,7 @@ impl Client {
/// bot.walk(WalkDirection::None);
/// # }
/// ```
- pub fn sprint(&mut self, direction: SprintDirection) {
+ pub fn sprint(&self, direction: SprintDirection) {
let mut ecs = self.ecs.lock();
ecs.send_event(StartSprintEvent {
entity: self.entity,