aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins
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
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')
-rw-r--r--azalea-client/src/plugins/interact.rs2
-rw-r--r--azalea-client/src/plugins/mining.rs2
-rw-r--r--azalea-client/src/plugins/movement.rs8
3 files changed, 6 insertions, 6 deletions
diff --git a/azalea-client/src/plugins/interact.rs b/azalea-client/src/plugins/interact.rs
index a0dfa12a..f9513183 100644
--- a/azalea-client/src/plugins/interact.rs
+++ b/azalea-client/src/plugins/interact.rs
@@ -75,7 +75,7 @@ impl Client {
///
/// Note that this may trigger anticheats as it doesn't take into account
/// whether you're actually looking at the block.
- pub fn block_interact(&mut self, position: BlockPos) {
+ pub fn block_interact(&self, position: BlockPos) {
self.ecs.lock().send_event(BlockInteractEvent {
entity: self.entity,
position,
diff --git a/azalea-client/src/plugins/mining.rs b/azalea-client/src/plugins/mining.rs
index d4a6f2a0..2dd50700 100644
--- a/azalea-client/src/plugins/mining.rs
+++ b/azalea-client/src/plugins/mining.rs
@@ -64,7 +64,7 @@ impl Plugin for MiningPlugin {
pub struct MiningSet;
impl Client {
- pub fn start_mining(&mut self, position: BlockPos) {
+ pub fn start_mining(&self, position: BlockPos) {
self.ecs.lock().send_event(StartMiningBlockEvent {
entity: self.entity,
position,
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,