aboutsummaryrefslogtreecommitdiff
path: root/azalea
diff options
context:
space:
mode:
Diffstat (limited to 'azalea')
-rw-r--r--azalea/build.rs3
-rw-r--r--azalea/examples/nearest_entity.rs10
-rw-r--r--azalea/examples/steal.rs6
-rw-r--r--azalea/examples/testbot/commands.rs10
-rw-r--r--azalea/examples/testbot/main.rs14
-rw-r--r--azalea/src/accept_resource_packs.rs24
-rw-r--r--azalea/src/bot.rs36
-rw-r--r--azalea/src/container.rs5
-rw-r--r--azalea/src/lib.rs6
-rw-r--r--azalea/src/pathfinder/mod.rs66
-rw-r--r--azalea/src/prelude.rs6
11 files changed, 98 insertions, 88 deletions
diff --git a/azalea/build.rs b/azalea/build.rs
index cd0a16b2..faed1365 100644
--- a/azalea/build.rs
+++ b/azalea/build.rs
@@ -1,5 +1,4 @@
-use std::env;
-use std::process::Command;
+use std::{env, process::Command};
fn main() {
// If using `rustup`, check the toolchain via `RUSTUP_TOOLCHAIN`
diff --git a/azalea/examples/nearest_entity.rs b/azalea/examples/nearest_entity.rs
index 1fb6bdd1..2e6973cf 100644
--- a/azalea/examples/nearest_entity.rs
+++ b/azalea/examples/nearest_entity.rs
@@ -1,10 +1,10 @@
-use azalea::ClientBuilder;
-use azalea::nearest_entity::EntityFinder;
-use azalea::{Bot, LookAtEvent};
+use azalea::{Bot, ClientBuilder, LookAtEvent, nearest_entity::EntityFinder};
use azalea_client::Account;
use azalea_core::tick::GameTick;
-use azalea_entity::metadata::{ItemItem, Player};
-use azalea_entity::{EyeHeight, LocalEntity, Position};
+use azalea_entity::{
+ EyeHeight, LocalEntity, Position,
+ metadata::{ItemItem, Player},
+};
use bevy_app::Plugin;
use bevy_ecs::{
prelude::{Entity, EventWriter},
diff --git a/azalea/examples/steal.rs b/azalea/examples/steal.rs
index 028c1b5a..899c2568 100644
--- a/azalea/examples/steal.rs
+++ b/azalea/examples/steal.rs
@@ -2,10 +2,8 @@
use std::sync::Arc;
-use azalea::pathfinder::goals::RadiusGoal;
-use azalea::{BlockPos, prelude::*};
-use azalea_inventory::ItemStack;
-use azalea_inventory::operations::QuickMoveClick;
+use azalea::{BlockPos, pathfinder::goals::RadiusGoal, prelude::*};
+use azalea_inventory::{ItemStack, operations::QuickMoveClick};
use parking_lot::Mutex;
#[tokio::main]
diff --git a/azalea/examples/testbot/commands.rs b/azalea/examples/testbot/commands.rs
index 4e261e17..da6b7cc2 100644
--- a/azalea/examples/testbot/commands.rs
+++ b/azalea/examples/testbot/commands.rs
@@ -2,12 +2,10 @@ pub mod combat;
pub mod debug;
pub mod movement;
-use azalea::Client;
-use azalea::GameProfileComponent;
-use azalea::brigadier::prelude::*;
-use azalea::chat::ChatPacket;
-use azalea::ecs::prelude::*;
-use azalea::entity::metadata::Player;
+use azalea::{
+ Client, GameProfileComponent, brigadier::prelude::*, chat::ChatPacket, ecs::prelude::*,
+ entity::metadata::Player,
+};
use parking_lot::Mutex;
use crate::State;
diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs
index 1aa9485d..8a35a281 100644
--- a/azalea/examples/testbot/main.rs
+++ b/azalea/examples/testbot/main.rs
@@ -25,16 +25,12 @@
mod commands;
pub mod killaura;
-use std::time::Duration;
-use std::{env, process};
-use std::{sync::Arc, thread};
+use std::{env, process, sync::Arc, thread, time::Duration};
-use azalea::ClientInformation;
-use azalea::brigadier::command_dispatcher::CommandDispatcher;
-use azalea::ecs::prelude::*;
-use azalea::pathfinder::debug::PathfinderDebugParticles;
-use azalea::prelude::*;
-use azalea::swarm::prelude::*;
+use azalea::{
+ ClientInformation, brigadier::command_dispatcher::CommandDispatcher, ecs::prelude::*,
+ pathfinder::debug::PathfinderDebugParticles, prelude::*, swarm::prelude::*,
+};
use commands::{CommandSource, register_commands};
use parking_lot::Mutex;
diff --git a/azalea/src/accept_resource_packs.rs b/azalea/src/accept_resource_packs.rs
index c310d541..4518abcb 100644
--- a/azalea/src/accept_resource_packs.rs
+++ b/azalea/src/accept_resource_packs.rs
@@ -1,12 +1,18 @@
-use azalea_client::InConfigState;
-use azalea_client::chunks::handle_chunk_batch_finished_event;
-use azalea_client::inventory::InventorySet;
-use azalea_client::packet::config::SendConfigPacketEvent;
-use azalea_client::packet::game::SendPacketEvent;
-use azalea_client::packet::{death_event_on_0_health, game::ResourcePackEvent};
-use azalea_client::respawn::perform_respawn;
-use azalea_protocol::packets::config;
-use azalea_protocol::packets::game::s_resource_pack::{self, ServerboundResourcePack};
+use azalea_client::{
+ InConfigState,
+ chunks::handle_chunk_batch_finished_event,
+ inventory::InventorySet,
+ packet::{
+ config::SendConfigPacketEvent,
+ death_event_on_0_health,
+ game::{ResourcePackEvent, SendPacketEvent},
+ },
+ respawn::perform_respawn,
+};
+use azalea_protocol::packets::{
+ config,
+ game::s_resource_pack::{self, ServerboundResourcePack},
+};
use bevy_app::Update;
use bevy_ecs::prelude::*;
diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs
index 63a3adcb..8bc9d594 100644
--- a/azalea/src/bot.rs
+++ b/azalea/src/bot.rs
@@ -1,9 +1,13 @@
use std::f64::consts::PI;
-use azalea_client::mining::Mining;
-use azalea_client::tick_broadcast::{TickBroadcast, UpdateBroadcast};
-use azalea_core::position::{BlockPos, Vec3};
-use azalea_core::tick::GameTick;
+use azalea_client::{
+ mining::Mining,
+ tick_broadcast::{TickBroadcast, UpdateBroadcast},
+};
+use azalea_core::{
+ position::{BlockPos, Vec3},
+ tick::GameTick,
+};
use azalea_entity::{
EyeHeight, Jumping, LocalEntity, LookDirection, Position, clamp_look_direction,
metadata::Player,
@@ -14,18 +18,20 @@ use bevy_ecs::prelude::*;
use futures_lite::Future;
use tracing::trace;
-use crate::accept_resource_packs::AcceptResourcePacksPlugin;
-use crate::app::{App, Plugin, PluginGroup, PluginGroupBuilder};
-use crate::auto_respawn::AutoRespawnPlugin;
-use crate::container::ContainerPlugin;
-use crate::ecs::{
- component::Component,
- entity::Entity,
- event::EventReader,
- query::{With, Without},
- system::{Commands, Query},
+use crate::{
+ accept_resource_packs::AcceptResourcePacksPlugin,
+ app::{App, Plugin, PluginGroup, PluginGroupBuilder},
+ auto_respawn::AutoRespawnPlugin,
+ container::ContainerPlugin,
+ ecs::{
+ component::Component,
+ entity::Entity,
+ event::EventReader,
+ query::{With, Without},
+ system::{Commands, Query},
+ },
+ pathfinder::PathfinderPlugin,
};
-use crate::pathfinder::PathfinderPlugin;
#[derive(Clone, Default)]
pub struct BotPlugin;
diff --git a/azalea/src/container.rs b/azalea/src/container.rs
index ebc033f3..6715cd63 100644
--- a/azalea/src/container.rs
+++ b/azalea/src/container.rs
@@ -1,10 +1,9 @@
-use std::fmt;
-use std::fmt::Debug;
+use std::{fmt, fmt::Debug};
-use azalea_client::packet::game::ReceiveGamePacketEvent;
use azalea_client::{
Client,
inventory::{CloseContainerEvent, ContainerClickEvent, Inventory},
+ packet::game::ReceiveGamePacketEvent,
};
use azalea_core::position::BlockPos;
use azalea_inventory::{ItemStack, Menu, operations::ClickOperation};
diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs
index 26dde1fa..25c317e2 100644
--- a/azalea/src/lib.rs
+++ b/azalea/src/lib.rs
@@ -13,8 +13,7 @@ pub mod pathfinder;
pub mod prelude;
pub mod swarm;
-use std::net::SocketAddr;
-use std::time::Duration;
+use std::{net::SocketAddr, time::Duration};
use app::Plugins;
pub use azalea_auth as auth;
@@ -39,8 +38,7 @@ pub use bevy_ecs as ecs;
pub use bot::*;
use ecs::component::Component;
use futures::{Future, future::BoxFuture};
-use protocol::connect::Proxy;
-use protocol::{ServerAddress, resolver::ResolverError};
+use protocol::{ServerAddress, connect::Proxy, resolver::ResolverError};
use swarm::SwarmBuilder;
use thiserror::Error;
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index 58c3736c..1b8a71c8 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -12,23 +12,27 @@ pub mod rel_block_pos;
pub mod simulation;
pub mod world;
-use std::collections::VecDeque;
-use std::ops::RangeInclusive;
-use std::sync::Arc;
-use std::sync::atomic::{self, AtomicUsize};
-use std::time::{Duration, Instant};
-use std::{cmp, thread};
+use std::{
+ cmp,
+ collections::VecDeque,
+ ops::RangeInclusive,
+ sync::{
+ Arc,
+ atomic::{self, AtomicUsize},
+ },
+ thread,
+ time::{Duration, Instant},
+};
use astar::{Edge, PathfinderTimeout};
-use azalea_client::inventory::{Inventory, InventorySet, SetSelectedHotbarSlotEvent};
-use azalea_client::mining::{Mining, StartMiningBlockEvent};
-use azalea_client::movement::MoveEventsSet;
-use azalea_client::{InstanceHolder, StartSprintEvent, StartWalkEvent};
-use azalea_core::position::BlockPos;
-use azalea_core::tick::GameTick;
-use azalea_entity::LocalEntity;
-use azalea_entity::metadata::Player;
-use azalea_entity::{Physics, Position};
+use azalea_client::{
+ InstanceHolder, StartSprintEvent, StartWalkEvent,
+ inventory::{Inventory, InventorySet, SetSelectedHotbarSlotEvent},
+ mining::{Mining, StartMiningBlockEvent},
+ movement::MoveEventsSet,
+};
+use azalea_core::{position::BlockPos, tick::GameTick};
+use azalea_entity::{LocalEntity, Physics, Position, metadata::Player};
use azalea_physics::PhysicsSet;
use azalea_world::{InstanceContainer, InstanceName};
use bevy_app::{PreUpdate, Update};
@@ -41,21 +45,25 @@ use rel_block_pos::RelBlockPos;
use tokio::sync::broadcast::error::RecvError;
use tracing::{debug, error, info, trace, warn};
-use self::debug::debug_render_path_with_particles;
-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 self::{
+ debug::debug_render_path_with_particles,
+ goals::Goal,
+ mining::MiningCache,
+ moves::{ExecuteCtx, IsReachedCtx, SuccessorsFn},
+};
+use crate::{
+ BotClientExt, WalkDirection,
+ app::{App, Plugin},
+ bot::{JumpEvent, LookAtEvent},
+ ecs::{
+ component::Component,
+ entity::Entity,
+ event::{EventReader, EventWriter},
+ query::{With, Without},
+ system::{Commands, Query, Res},
+ },
+ pathfinder::{astar::a_star, moves::PathfinderCtx, world::CachedWorld},
};
-use crate::pathfinder::{astar::a_star, moves::PathfinderCtx, world::CachedWorld};
-use crate::{BotClientExt, WalkDirection};
#[derive(Clone, Default)]
pub struct PathfinderPlugin;
diff --git a/azalea/src/prelude.rs b/azalea/src/prelude.rs
index 648fad6a..969b1e86 100644
--- a/azalea/src/prelude.rs
+++ b/azalea/src/prelude.rs
@@ -6,8 +6,10 @@ pub use azalea_core::tick::GameTick;
// this is necessary to make the macros that reference bevy_ecs work
pub use crate::ecs as bevy_ecs;
-pub use crate::ecs::{component::Component, resource::Resource};
pub use crate::{
- ClientBuilder, bot::BotClientExt, container::ContainerClientExt,
+ ClientBuilder,
+ bot::BotClientExt,
+ container::ContainerClientExt,
+ ecs::{component::Component, resource::Resource},
pathfinder::PathfinderClientExt,
};