diff options
| author | mat <git@matdoes.dev> | 2025-12-15 11:14:40 +0930 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-12-15 11:14:40 +0930 |
| commit | dcbd690f21665e22ea250024a1aa85dec34e6c9e (patch) | |
| tree | 411c76eb92ca1cfe284e56f47bc0abd4079a3364 /azalea/src | |
| parent | b0a2a809331b0f781517649857d31e0aec67d300 (diff) | |
| download | azalea-drasl-dcbd690f21665e22ea250024a1aa85dec34e6c9e.tar.xz | |
sort derives with cargo sort-derives
might add to ci later, unsure how to do it without adding significant friction for contributors though
Diffstat (limited to 'azalea/src')
| -rw-r--r-- | azalea/src/bot.rs | 2 | ||||
| -rw-r--r-- | azalea/src/lib.rs | 8 | ||||
| -rw-r--r-- | azalea/src/pathfinder/astar.rs | 2 | ||||
| -rw-r--r-- | azalea/src/pathfinder/debug.rs | 2 | ||||
| -rw-r--r-- | azalea/src/pathfinder/mod.rs | 6 | ||||
| -rw-r--r-- | azalea/src/pathfinder/rel_block_pos.rs | 2 | ||||
| -rw-r--r-- | azalea/src/swarm/chat.rs | 2 | ||||
| -rw-r--r-- | azalea/src/swarm/events.rs | 2 | ||||
| -rw-r--r-- | azalea/src/swarm/mod.rs | 18 |
9 files changed, 22 insertions, 22 deletions
diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs index 6d7dc774..3c262709 100644 --- a/azalea/src/bot.rs +++ b/azalea/src/bot.rs @@ -61,7 +61,7 @@ impl Plugin for BotPlugin { /// /// If you just want to check if an entity is one of our bots, you should use /// [`LocalEntity`]. -#[derive(Default, Component)] +#[derive(Component, Default)] pub struct Bot { jumping_once: bool, } diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index 45c0114d..44c1fe0c 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -70,7 +70,7 @@ pub type HandleFn<S, Fut> = fn(Client, azalea_client::Event, S) -> Fut; /// .start(Account::offline("bot"), "localhost") /// .await; /// # } -/// # #[derive(Component, Clone, Default)] +/// # #[derive(Clone, Component, Default)] /// # pub struct State; /// # async fn handle(mut bot: Client, event: Event, state: State) -> anyhow::Result<()> { /// # Ok(()) @@ -118,7 +118,7 @@ impl ClientBuilder<NoState, ()> { /// ) /// .add_plugins(azalea::bot::DefaultBotPlugins); /// # client_builder.set_handler(handle); - /// # #[derive(Component, Clone, Default)] + /// # #[derive(Clone, Component, Default)] /// # pub struct State; /// # async fn handle(mut bot: Client, event: Event, state: State) -> anyhow::Result<()> { /// # Ok(()) @@ -146,7 +146,7 @@ impl ClientBuilder<NoState, ()> { /// # let client_builder = azalea::ClientBuilder::new(); /// client_builder.set_handler(handle); /// - /// # #[derive(Component, Clone, Default)] + /// # #[derive(Clone, Component, Default)] /// # pub struct State; /// async fn handle(mut bot: Client, event: Event, state: State) -> anyhow::Result<()> { /// Ok(()) @@ -254,7 +254,7 @@ impl Default for ClientBuilder<NoState, ()> { /// it for you. /// /// [`SwarmBuilder`]: swarm::SwarmBuilder -#[derive(Component, Clone, Default)] +#[derive(Clone, Component, Default)] pub struct NoState; /// Optional settings when adding an account to a swarm or client. diff --git a/azalea/src/pathfinder/astar.rs b/azalea/src/pathfinder/astar.rs index d2a57b38..ed776bec 100644 --- a/azalea/src/pathfinder/astar.rs +++ b/azalea/src/pathfinder/astar.rs @@ -310,7 +310,7 @@ impl PartialOrd for WeightedNode { /// /// [`PathfinderOpts::min_timeout`]: super::goto_event::PathfinderOpts::min_timeout /// [`PathfinderOpts::max_timeout`]: super::goto_event::PathfinderOpts::max_timeout -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum PathfinderTimeout { /// Time out after a certain duration has passed. /// diff --git a/azalea/src/pathfinder/debug.rs b/azalea/src/pathfinder/debug.rs index 4b241e5d..f8dc1193 100644 --- a/azalea/src/pathfinder/debug.rs +++ b/azalea/src/pathfinder/debug.rs @@ -15,7 +15,7 @@ use super::ExecutingPath; /// ``` /// # use azalea::prelude::*; /// # use azalea::pathfinder::debug::PathfinderDebugParticles; -/// # #[derive(Component, Clone, Default)] +/// # #[derive(Clone, Component, Default)] /// # pub struct State; /// /// async fn handle(mut bot: Client, event: azalea::Event, state: State) -> anyhow::Result<()> { diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index 81b2b845..90b506e9 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -121,7 +121,7 @@ impl Plugin for PathfinderPlugin { } /// A component that makes this client able to pathfind. -#[derive(Component, Default, Clone)] +#[derive(Clone, Component, Default)] #[non_exhaustive] pub struct Pathfinder { pub goal: Option<Arc<dyn Goal>>, @@ -132,7 +132,7 @@ pub struct Pathfinder { /// A component that's present on clients that are actively following a /// pathfinder path. -#[derive(Component, Clone)] +#[derive(Clone, Component)] pub struct ExecutingPath { pub path: VecDeque<astar::Edge<BlockPos, moves::MoveData>>, pub queued_path: Option<VecDeque<astar::Edge<BlockPos, moves::MoveData>>>, @@ -141,7 +141,7 @@ pub struct ExecutingPath { pub is_path_partial: bool, } -#[derive(Message, Clone, Debug)] +#[derive(Clone, Debug, Message)] #[non_exhaustive] pub struct PathFoundEvent { pub entity: Entity, diff --git a/azalea/src/pathfinder/rel_block_pos.rs b/azalea/src/pathfinder/rel_block_pos.rs index b5fd23dc..6b5fa69a 100644 --- a/azalea/src/pathfinder/rel_block_pos.rs +++ b/azalea/src/pathfinder/rel_block_pos.rs @@ -7,7 +7,7 @@ use azalea_core::position::BlockPos; /// This fits in 64 bits, so it's more efficient than a BlockPos in some cases. /// /// The X and Z are limited to ±32k. -#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[repr(C)] pub struct RelBlockPos { pub x: i16, diff --git a/azalea/src/swarm/chat.rs b/azalea/src/swarm/chat.rs index 46741be6..0bad69c1 100644 --- a/azalea/src/swarm/chat.rs +++ b/azalea/src/swarm/chat.rs @@ -43,7 +43,7 @@ pub struct ClientChatState { } /// A chat message that no other bots have seen yet was received by a bot. -#[derive(Message, Debug)] +#[derive(Debug, Message)] pub struct NewChatMessageEvent(ChatPacket); #[derive(Resource)] diff --git a/azalea/src/swarm/events.rs b/azalea/src/swarm/events.rs index 78fb6127..107a676a 100644 --- a/azalea/src/swarm/events.rs +++ b/azalea/src/swarm/events.rs @@ -17,7 +17,7 @@ impl Plugin for SwarmPlugin { #[derive(Message)] pub struct SwarmReadyEvent; -#[derive(Default, Resource, Deref, DerefMut)] +#[derive(Default, Deref, DerefMut, Resource)] struct IsSwarmReady(bool); fn check_ready( diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 0a02e490..360c9939 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -131,7 +131,7 @@ impl SwarmBuilder<NoState, NoSwarmState, (), ()> { /// .add_plugins(azalea::bot::DefaultBotPlugins) /// .add_plugins(azalea::swarm::DefaultSwarmPlugins); /// # swarm_builder.set_handler(handle).set_swarm_handler(swarm_handle); - /// # #[derive(Component, Resource, Clone, Default)] + /// # #[derive(Clone, Component, Default, Resource)] /// # pub struct State; /// # async fn handle(mut bot: Client, event: Event, state: State) -> anyhow::Result<()> { /// # Ok(()) @@ -183,13 +183,13 @@ where /// # let swarm_builder = SwarmBuilder::new().set_swarm_handler(swarm_handle); /// swarm_builder.set_handler(handle); /// - /// #[derive(Component, Default, Clone)] + /// #[derive(Clone, Component, Default)] /// struct State {} /// async fn handle(mut bot: Client, event: Event, state: State) -> anyhow::Result<()> { /// Ok(()) /// } /// - /// # #[derive(Resource, Default, Clone)] + /// # #[derive(Clone, Default, Resource)] /// # struct SwarmState {} /// # async fn swarm_handle( /// # mut swarm: Swarm, @@ -239,14 +239,14 @@ where /// # let swarm_builder = SwarmBuilder::new().set_handler(handle); /// swarm_builder.set_swarm_handler(swarm_handle); /// - /// # #[derive(Component, Default, Clone)] + /// # #[derive(Clone, Component, Default)] /// # struct State {} /// /// # async fn handle(mut bot: Client, event: Event, state: State) -> anyhow::Result<()> { /// # Ok(()) /// # } /// - /// #[derive(Resource, Default, Clone)] + /// #[derive(Clone, Default, Resource)] /// struct SwarmState {} /// async fn swarm_handle( /// mut swarm: Swarm, @@ -673,10 +673,10 @@ pub type BoxSwarmHandleFn<SS, R> = /// use azalea::{prelude::*, swarm::prelude::*}; /// use std::time::Duration; /// -/// #[derive(Default, Clone, Component)] +/// #[derive(Clone, Component, Default)] /// struct State {} /// -/// #[derive(Default, Clone, Resource)] +/// #[derive(Clone, Default, Resource)] /// struct SwarmState {} /// /// #[tokio::main] @@ -884,7 +884,7 @@ impl IntoIterator for Swarm { /// /// ```rust,no_run /// # use azalea::{prelude::*, swarm::prelude::*}; - /// #[derive(Component, Clone)] + /// #[derive(Clone, Component)] /// # pub struct State; /// # fn example(swarm: Swarm) { /// for bot in swarm { @@ -920,5 +920,5 @@ impl PluginGroup for DefaultSwarmPlugins { /// /// You probably don't need to use this manually since the compiler will infer /// it for you. -#[derive(Resource, Clone, Default)] +#[derive(Clone, Default, Resource)] pub struct NoSwarmState; |
