Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Aug 11, 2024
1 parent b445b7c commit 5ab9c50
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion azalea-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
21 changes: 9 additions & 12 deletions azalea-client/src/mining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -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 });
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion azalea-inventory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions azalea/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit 5ab9c50

Please sign in to comment.