diff options
| author | mat <git@matdoes.dev> | 2024-08-11 09:03:57 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-08-11 09:03:57 +0000 |
| commit | 5ab9c501e93907a8a688266fd027a48bbf1c2eca (patch) | |
| tree | 5a50b0f1422dfe9a8ab80bac8aec349c5580fc4a | |
| parent | b445b7c032be90304c624bce612c1ea2d62d8375 (diff) | |
| download | azalea-drasl-5ab9c501e93907a8a688266fd027a48bbf1c2eca.tar.xz | |
fmt
| -rw-r--r-- | azalea-client/src/lib.rs | 2 | ||||
| -rw-r--r-- | azalea-client/src/mining.rs | 21 | ||||
| -rw-r--r-- | azalea-inventory/src/lib.rs | 2 | ||||
| -rw-r--r-- | azalea/build.rs | 6 |
4 files changed, 15 insertions, 16 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 }); } } } diff --git a/azalea-inventory/src/lib.rs b/azalea-inventory/src/lib.rs index 876269e5..930c1a5d 100644 --- a/azalea-inventory/src/lib.rs +++ b/azalea-inventory/src/lib.rs @@ -9,7 +9,7 @@ mod slot; use std::ops::{Deref, DerefMut, RangeInclusive}; use azalea_inventory_macros::declare_menus; -pub use slot::{ItemSlot, ItemSlotData, DataComponentPatch}; +pub use slot::{DataComponentPatch, ItemSlot, ItemSlotData}; // TODO: remove this here and in azalea-inventory-macros when rust makes // Default be implemented for all array sizes diff --git a/azalea/build.rs b/azalea/build.rs index 25fff0e5..6fe00484 100644 --- a/azalea/build.rs +++ b/azalea/build.rs @@ -3,11 +3,13 @@ use std::process::Command; fn main() { match env::var("RUSTUP_TOOLCHAIN") { - Ok(rust_toolchain) if !rust_toolchain.starts_with("nightly") => { // stable & beta + Ok(rust_toolchain) if !rust_toolchain.starts_with("nightly") => { + // stable & beta panic!("Azalea currently requires nightly Rust. You can use `rustup override set nightly` to set the toolchain for this directory."); } Ok(_) => return, // nightly - Err(_) => { // probably not installed via rustup, run rustc and parse its output + Err(_) => { + // probably not installed via rustup, run rustc and parse its output let rustc_command = env::var("RUSTC") .or_else(|_| env::var("CARGO_BUILD_RUSTC")) .unwrap_or(String::from("rustc")); |
