From 5ab9c501e93907a8a688266fd027a48bbf1c2eca Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 11 Aug 2024 09:03:57 +0000 Subject: fmt --- azalea-client/src/lib.rs | 2 +- azalea-client/src/mining.rs | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'azalea-client/src') diff --git a/azalea-client/src/lib.rs b/azalea-client/src/lib.rs index 17921673..93e08717 100644 --- a/azalea-client/src/lib.rs +++ b/azalea-client/src/lib.rs @@ -36,7 +36,7 @@ pub use client::{ TickBroadcast, }; pub use events::Event; -pub use local_player::{GameProfileComponent, InstanceHolder, TabList, Hunger}; +pub use local_player::{GameProfileComponent, Hunger, InstanceHolder, TabList}; pub use movement::{ PhysicsState, SprintDirection, StartSprintEvent, StartWalkEvent, WalkDirection, }; diff --git a/azalea-client/src/mining.rs b/azalea-client/src/mining.rs index 54e27013..0bf416ff 100644 --- a/azalea-client/src/mining.rs +++ b/azalea-client/src/mining.rs @@ -35,12 +35,9 @@ impl Plugin for MinePlugin { .add_event::() .add_systems( GameTick, - ( - continue_mining_block, - handle_auto_mine - ) + (continue_mining_block, handle_auto_mine) .chain() - .before(PhysicsSet) + .before(PhysicsSet), ) .add_systems( Update, @@ -75,7 +72,8 @@ impl Client { }); } - /// When enabled, the bot will mine any block that it is looking at if it is reachable. + /// When enabled, the bot will mine any block that it is looking at if it is + /// reachable. pub fn left_click_mine(&self, enabled: bool) { let mut ecs = self.ecs.lock(); let mut entity_mut = ecs.entity_mut(self.entity); @@ -105,7 +103,7 @@ fn handle_auto_mine( With, >, mut start_mining_block_event: EventWriter, - mut stop_mining_block_event: EventWriter + mut stop_mining_block_event: EventWriter, ) { for ( hit_result_component, @@ -124,16 +122,15 @@ fn handle_auto_mine( inventory, current_mining_pos, current_mining_item, - )) && !hit_result_component.miss + )) + && !hit_result_component.miss { start_mining_block_event.send(StartMiningBlockEvent { entity, position: block_pos, }); - } else if mining.is_some() && hit_result_component.miss { - stop_mining_block_event.send(StopMiningBlockEvent { - entity - }); + } else if mining.is_some() && hit_result_component.miss { + stop_mining_block_event.send(StopMiningBlockEvent { entity }); } } } -- cgit v1.2.3