diff options
| author | mat <git@matdoes.dev> | 2024-10-26 05:29:26 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-10-26 05:29:26 +0000 |
| commit | 6b0fe5bf638079d535e70c3c91e78fe35a5d2a2f (patch) | |
| tree | 3b65d2984a0cffbe5acb3d44d7e3b8b145c32f95 /azalea/src/pathfinder | |
| parent | b762575db61cf775d603e11eb2bd27ae13bdc4e9 (diff) | |
| download | azalea-drasl-6b0fe5bf638079d535e70c3c91e78fe35a5d2a2f.tar.xz | |
group imports with rustfmt
Diffstat (limited to 'azalea/src/pathfinder')
| -rw-r--r-- | azalea/src/pathfinder/mining.rs | 3 | ||||
| -rw-r--r-- | azalea/src/pathfinder/mod.rs | 34 | ||||
| -rw-r--r-- | azalea/src/pathfinder/moves/basic.rs | 3 | ||||
| -rw-r--r-- | azalea/src/pathfinder/moves/mod.rs | 14 | ||||
| -rw-r--r-- | azalea/src/pathfinder/moves/parkour.rs | 3 | ||||
| -rw-r--r-- | azalea/src/pathfinder/world.rs | 3 |
6 files changed, 29 insertions, 31 deletions
diff --git a/azalea/src/pathfinder/mining.rs b/azalea/src/pathfinder/mining.rs index 1bc08c43..31b37b49 100644 --- a/azalea/src/pathfinder/mining.rs +++ b/azalea/src/pathfinder/mining.rs @@ -4,9 +4,8 @@ use azalea_block::{BlockState, BlockStates}; use azalea_inventory::Menu; use nohash_hasher::IntMap; -use crate::auto_tool::best_tool_in_hotbar_for_block; - use super::costs::BLOCK_BREAK_ADDITIONAL_PENALTY; +use crate::auto_tool::best_tool_in_hotbar_for_block; pub struct MiningCache { block_state_id_costs: UnsafeCell<IntMap<u32, f32>>, diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index cb6ba2bb..1f864526 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -11,20 +11,11 @@ pub mod moves; pub mod simulation; pub mod world; -use crate::bot::{JumpEvent, LookAtEvent}; -use crate::pathfinder::astar::a_star; -use crate::WalkDirection; +use std::collections::VecDeque; +use std::sync::atomic::{self, AtomicUsize}; +use std::sync::Arc; +use std::time::{Duration, Instant}; -use crate::app::{App, Plugin}; -use crate::ecs::{ - component::Component, - entity::Entity, - event::{EventReader, EventWriter}, - query::{With, Without}, - system::{Commands, Query, Res}, -}; -use crate::pathfinder::moves::PathfinderCtx; -use crate::pathfinder::world::CachedWorld; use azalea_client::inventory::{Inventory, InventorySet, SetSelectedHotbarSlotEvent}; use azalea_client::mining::{Mining, StartMiningBlockEvent}; use azalea_client::movement::MoveEventsSet; @@ -42,10 +33,6 @@ use bevy_ecs::query::Changed; use bevy_ecs::schedule::IntoSystemConfigs; use bevy_tasks::{AsyncComputeTaskPool, Task}; use futures_lite::future; -use std::collections::VecDeque; -use std::sync::atomic::{self, AtomicUsize}; -use std::sync::Arc; -use std::time::{Duration, Instant}; use tracing::{debug, error, info, trace, warn}; use self::debug::debug_render_path_with_particles; @@ -53,6 +40,19 @@ pub use self::debug::PathfinderDebugParticles; use self::goals::Goal; use self::mining::MiningCache; use self::moves::{ExecuteCtx, IsReachedCtx, SuccessorsFn}; +use crate::app::{App, Plugin}; +use crate::bot::{JumpEvent, LookAtEvent}; +use crate::ecs::{ + component::Component, + entity::Entity, + event::{EventReader, EventWriter}, + query::{With, Without}, + system::{Commands, Query, Res}, +}; +use crate::pathfinder::astar::a_star; +use crate::pathfinder::moves::PathfinderCtx; +use crate::pathfinder::world::CachedWorld; +use crate::WalkDirection; #[derive(Clone, Default)] pub struct PathfinderPlugin; diff --git a/azalea/src/pathfinder/moves/basic.rs b/azalea/src/pathfinder/moves/basic.rs index 54a6dc6a..bb931caf 100644 --- a/azalea/src/pathfinder/moves/basic.rs +++ b/azalea/src/pathfinder/moves/basic.rs @@ -6,9 +6,8 @@ use azalea_core::{ position::{BlockPos, Vec3}, }; -use crate::pathfinder::{astar, costs::*}; - use super::{default_is_reached, Edge, ExecuteCtx, IsReachedCtx, MoveData, PathfinderCtx}; +use crate::pathfinder::{astar, costs::*}; pub fn basic_move(ctx: &mut PathfinderCtx, node: BlockPos) { forward_move(ctx, node); diff --git a/azalea/src/pathfinder/moves/mod.rs b/azalea/src/pathfinder/moves/mod.rs index bb10b192..28974132 100644 --- a/azalea/src/pathfinder/moves/mod.rs +++ b/azalea/src/pathfinder/moves/mod.rs @@ -3,13 +3,6 @@ pub mod parkour; use std::{fmt::Debug, sync::Arc}; -use crate::{auto_tool::best_tool_in_hotbar_for_block, JumpEvent, LookAtEvent}; - -use super::{ - astar, - mining::MiningCache, - world::{is_block_state_passable, CachedWorld}, -}; use azalea_client::{ inventory::SetSelectedHotbarSlotEvent, mining::StartMiningBlockEvent, SprintDirection, StartSprintEvent, StartWalkEvent, WalkDirection, @@ -20,6 +13,13 @@ use azalea_world::Instance; use bevy_ecs::{entity::Entity, event::EventWriter}; use parking_lot::RwLock; +use super::{ + astar, + mining::MiningCache, + world::{is_block_state_passable, CachedWorld}, +}; +use crate::{auto_tool::best_tool_in_hotbar_for_block, JumpEvent, LookAtEvent}; + type Edge = astar::Edge<BlockPos, MoveData>; pub type SuccessorsFn = fn(&mut PathfinderCtx, BlockPos); diff --git a/azalea/src/pathfinder/moves/parkour.rs b/azalea/src/pathfinder/moves/parkour.rs index 66f02197..0f279dca 100644 --- a/azalea/src/pathfinder/moves/parkour.rs +++ b/azalea/src/pathfinder/moves/parkour.rs @@ -1,9 +1,8 @@ use azalea_client::{SprintDirection, WalkDirection}; use azalea_core::{direction::CardinalDirection, position::BlockPos}; -use crate::pathfinder::{astar, costs::*}; - use super::{Edge, ExecuteCtx, IsReachedCtx, MoveData, PathfinderCtx}; +use crate::pathfinder::{astar, costs::*}; pub fn parkour_move(ctx: &mut PathfinderCtx, node: BlockPos) { parkour_forward_1_move(ctx, node); diff --git a/azalea/src/pathfinder/world.rs b/azalea/src/pathfinder/world.rs index 2d859026..3a004f65 100644 --- a/azalea/src/pathfinder/world.rs +++ b/azalea/src/pathfinder/world.rs @@ -490,9 +490,10 @@ pub fn is_block_state_solid(block: BlockState) -> bool { #[cfg(test)] mod tests { - use super::*; use azalea_world::{Chunk, ChunkStorage, PartialInstance}; + use super::*; + #[test] fn test_is_passable() { let mut partial_world = PartialInstance::default(); |
