From 0611dbd1bfbe4e12d92a5ab399bc781b350561a1 Mon Sep 17 00:00:00 2001 From: Aditya Kumar <117935160+AS1100K@users.noreply.github.com> Date: Sat, 20 Jul 2024 15:18:17 +0530 Subject: [PATCH] Changed name to `LeftClickMine` --- azalea-client/src/mining.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/azalea-client/src/mining.rs b/azalea-client/src/mining.rs index 26d688e3a..6e4b58f37 100644 --- a/azalea-client/src/mining.rs +++ b/azalea-client/src/mining.rs @@ -39,7 +39,7 @@ impl Plugin for MinePlugin { GameTick, ( continue_mining_block, - handle_auto_mine + handle_left_click_mine ) .chain() .before(PhysicsSet), @@ -78,24 +78,23 @@ impl Client { } /// When enabled, the bot will mine any block that it is looking at if it is reachable. - /// By default, reachability is set to 5 blocks. - pub fn auto_mine(&self, enabled: bool) { + pub fn left_click_mine(&self, enabled: bool) { let mut ecs = self.ecs.lock(); let mut entity_mut = ecs.entity_mut(self.entity); if enabled { - entity_mut.insert(AutoMine); + entity_mut.insert(LeftClickMine); } else { - entity_mut.remove::(); + entity_mut.remove::(); } } } #[derive(Component)] -pub struct AutoMine; +pub struct LeftClickMine; #[allow(clippy::type_complexity)] -fn handle_auto_mine( +fn handle_left_click_mine( mut query: Query< ( &HitResultComponent, @@ -105,7 +104,7 @@ fn handle_auto_mine( &MineBlockPos, &MineItem, ), - (With, With, With), + (With, With, With), >, mut start_mining_block_event: EventWriter, mut stop_mining_block_event: EventWriter