diff options
Diffstat (limited to 'azalea-client/src')
| -rw-r--r-- | azalea-client/src/lib.rs | 2 | ||||
| -rw-r--r-- | azalea-client/src/mining.rs | 21 |
2 files changed, 10 insertions, 13 deletions
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::<AttackBlockEvent>() .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<LeftClickMine>, >, mut start_mining_block_event: EventWriter<StartMiningBlockEvent>, - mut stop_mining_block_event: EventWriter<StopMiningBlockEvent> + mut stop_mining_block_event: EventWriter<StopMiningBlockEvent>, ) { 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 }); } } } |
