aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-10-26 05:29:26 +0000
committermat <git@matdoes.dev>2024-10-26 05:29:26 +0000
commit6b0fe5bf638079d535e70c3c91e78fe35a5d2a2f (patch)
tree3b65d2984a0cffbe5acb3d44d7e3b8b145c32f95 /azalea-client/src
parentb762575db61cf775d603e11eb2bd27ae13bdc4e9 (diff)
downloadazalea-drasl-6b0fe5bf638079d535e70c3c91e78fe35a5d2a2f.tar.xz
group imports with rustfmt
Diffstat (limited to 'azalea-client/src')
-rwxr-xr-xazalea-client/src/chat.rs9
-rw-r--r--azalea-client/src/client.rs67
-rw-r--r--azalea-client/src/movement.rs8
-rw-r--r--azalea-client/src/packet_handling/mod.rs3
-rwxr-xr-xazalea-client/src/ping.rs3
5 files changed, 47 insertions, 43 deletions
diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs
index 1b4b7228..751893b7 100755
--- a/azalea-client/src/chat.rs
+++ b/azalea-client/src/chat.rs
@@ -1,5 +1,10 @@
//! Implementations of chat-related features.
+use std::{
+ sync::Arc,
+ time::{SystemTime, UNIX_EPOCH},
+};
+
use azalea_chat::FormattedText;
use azalea_protocol::packets::game::{
clientbound_disguised_chat_packet::ClientboundDisguisedChatPacket,
@@ -15,10 +20,6 @@ use bevy_ecs::{
prelude::Event,
schedule::IntoSystemConfigs,
};
-use std::{
- sync::Arc,
- time::{SystemTime, UNIX_EPOCH},
-};
use uuid::Uuid;
use crate::{
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index 7551aa9f..caeca7fe 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -1,27 +1,11 @@
-use crate::{
- attack::{self, AttackPlugin},
- chat::ChatPlugin,
- chunks::{ChunkBatchInfo, ChunkPlugin},
- configuration::ConfigurationPlugin,
- disconnect::{DisconnectEvent, DisconnectPlugin},
- events::{Event, EventPlugin, LocalPlayerEvents},
- interact::{CurrentSequenceNumber, InteractPlugin},
- inventory::{Inventory, InventoryPlugin},
- local_player::{
- death_event, GameProfileComponent, Hunger, InstanceHolder, PermissionLevel,
- PlayerAbilities, TabList,
- },
- mining::{self, MinePlugin},
- movement::{LastSentLookDirection, PhysicsState, PlayerMovePlugin},
- packet_handling::{
- login::{self, LoginSendPacketQueue},
- PacketHandlerPlugin,
- },
- player::retroactively_add_game_profile_component,
- raw_connection::RawConnection,
- respawn::RespawnPlugin,
- task_pool::TaskPoolPlugin,
- Account, PlayerInfo,
+use std::{
+ collections::HashMap,
+ fmt::Debug,
+ io,
+ net::SocketAddr,
+ ops::Deref,
+ sync::Arc,
+ time::{Duration, Instant},
};
use azalea_auth::{game_profile::GameProfile, sessionserver::ClientSessionServerError};
@@ -68,15 +52,6 @@ use bevy_ecs::{
use bevy_time::TimePlugin;
use derive_more::Deref;
use parking_lot::{Mutex, RwLock};
-use std::{
- collections::HashMap,
- fmt::Debug,
- io,
- net::SocketAddr,
- ops::Deref,
- sync::Arc,
- time::{Duration, Instant},
-};
use thiserror::Error;
use tokio::{
sync::{broadcast, mpsc},
@@ -85,6 +60,32 @@ use tokio::{
use tracing::{debug, error};
use uuid::Uuid;
+use crate::{
+ attack::{self, AttackPlugin},
+ chat::ChatPlugin,
+ chunks::{ChunkBatchInfo, ChunkPlugin},
+ configuration::ConfigurationPlugin,
+ disconnect::{DisconnectEvent, DisconnectPlugin},
+ events::{Event, EventPlugin, LocalPlayerEvents},
+ interact::{CurrentSequenceNumber, InteractPlugin},
+ inventory::{Inventory, InventoryPlugin},
+ local_player::{
+ death_event, GameProfileComponent, Hunger, InstanceHolder, PermissionLevel,
+ PlayerAbilities, TabList,
+ },
+ mining::{self, MinePlugin},
+ movement::{LastSentLookDirection, PhysicsState, PlayerMovePlugin},
+ packet_handling::{
+ login::{self, LoginSendPacketQueue},
+ PacketHandlerPlugin,
+ },
+ player::retroactively_add_game_profile_component,
+ raw_connection::RawConnection,
+ respawn::RespawnPlugin,
+ task_pool::TaskPoolPlugin,
+ Account, PlayerInfo,
+};
+
/// `Client` has the things that a user interacting with the library will want.
///
/// To make a new client, use either [`azalea::ClientBuilder`] or
diff --git a/azalea-client/src/movement.rs b/azalea-client/src/movement.rs
index 8905d0ef..806f8734 100644
--- a/azalea-client/src/movement.rs
+++ b/azalea-client/src/movement.rs
@@ -1,5 +1,5 @@
-use crate::client::Client;
-use crate::packet_handling::game::SendPacketEvent;
+use std::backtrace::Backtrace;
+
use azalea_core::position::Vec3;
use azalea_core::tick::GameTick;
use azalea_entity::{metadata::Sprinting, Attributes, Jumping};
@@ -20,9 +20,11 @@ use bevy_ecs::{
component::Component, entity::Entity, event::EventReader, query::With,
schedule::IntoSystemConfigs, system::Query,
};
-use std::backtrace::Backtrace;
use thiserror::Error;
+use crate::client::Client;
+use crate::packet_handling::game::SendPacketEvent;
+
#[derive(Error, Debug)]
pub enum MovePlayerError {
#[error("Player is not in world")]
diff --git a/azalea-client/src/packet_handling/mod.rs b/azalea-client/src/packet_handling/mod.rs
index 19de27eb..eb8f1d47 100644
--- a/azalea-client/src/packet_handling/mod.rs
+++ b/azalea-client/src/packet_handling/mod.rs
@@ -2,8 +2,6 @@ use azalea_entity::{metadata::Health, EntityUpdateSet};
use bevy_app::{App, First, Plugin, PreUpdate, Update};
use bevy_ecs::prelude::*;
-use crate::{chat::ChatReceivedEvent, events::death_listener};
-
use self::{
game::{
AddPlayerEvent, DeathEvent, InstanceLoadedEvent, KeepAliveEvent, RemovePlayerEvent,
@@ -11,6 +9,7 @@ use self::{
},
login::{LoginPacketEvent, SendLoginPacketEvent},
};
+use crate::{chat::ChatReceivedEvent, events::death_listener};
pub mod configuration;
pub mod game;
diff --git a/azalea-client/src/ping.rs b/azalea-client/src/ping.rs
index d0612392..ded1b521 100755
--- a/azalea-client/src/ping.rs
+++ b/azalea-client/src/ping.rs
@@ -1,5 +1,7 @@
//! Ping Minecraft servers.
+use std::io;
+
use azalea_protocol::{
connect::{Connection, ConnectionError, Proxy},
packets::{
@@ -16,7 +18,6 @@ use azalea_protocol::{
},
resolver, ServerAddress,
};
-use std::io;
use thiserror::Error;
#[derive(Error, Debug)]