diff options
| author | mat <git@matdoes.dev> | 2025-02-22 23:01:54 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-02-22 23:01:54 +0000 |
| commit | 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (patch) | |
| tree | 7920fec1203e8e96463a142f5f6da6164e76e684 /azalea-client | |
| parent | bdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff) | |
| download | azalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz | |
update to rust edition 2024
Diffstat (limited to 'azalea-client')
25 files changed, 108 insertions, 100 deletions
diff --git a/azalea-client/src/account.rs b/azalea-client/src/account.rs index 87573de0..5e2fafa7 100755 --- a/azalea-client/src/account.rs +++ b/azalea-client/src/account.rs @@ -2,8 +2,8 @@ use std::sync::Arc; -use azalea_auth::certs::{Certificates, FetchCertificatesError}; use azalea_auth::AccessTokenResponse; +use azalea_auth::certs::{Certificates, FetchCertificatesError}; use bevy_ecs::component::Component; use parking_lot::Mutex; use thiserror::Error; diff --git a/azalea-client/src/attack.rs b/azalea-client/src/attack.rs index f626483f..0f5a8305 100644 --- a/azalea-client/src/attack.rs +++ b/azalea-client/src/attack.rs @@ -1,7 +1,8 @@ use azalea_core::{game_type::GameMode, tick::GameTick}; use azalea_entity::{ + Attributes, Physics, metadata::{ShiftKeyDown, Sprinting}, - update_bounding_box, Attributes, Physics, + update_bounding_box, }; use azalea_physics::PhysicsSet; use azalea_protocol::packets::game::s_interact::{self, ServerboundInteract}; @@ -11,8 +12,8 @@ use bevy_ecs::prelude::*; use derive_more::{Deref, DerefMut}; use crate::{ - interact::SwingArmEvent, local_player::LocalGameMode, movement::MoveEventsSet, - packet_handling::game::SendPacketEvent, respawn::perform_respawn, Client, + Client, interact::SwingArmEvent, local_player::LocalGameMode, movement::MoveEventsSet, + packet_handling::game::SendPacketEvent, respawn::perform_respawn, }; pub struct AttackPlugin; diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs index 97fdde72..2bef9570 100755 --- a/azalea-client/src/chat.rs +++ b/azalea-client/src/chat.rs @@ -7,6 +7,7 @@ use std::{ use azalea_chat::FormattedText; use azalea_protocol::packets::{ + Packet, game::{ c_disguised_chat::ClientboundDisguisedChat, c_player_chat::ClientboundPlayerChat, @@ -14,7 +15,6 @@ use azalea_protocol::packets::{ s_chat::{LastSeenMessagesUpdate, ServerboundChat}, s_chat_command::ServerboundChatCommand, }, - Packet, }; use bevy_app::{App, Plugin, Update}; use bevy_ecs::{ @@ -27,7 +27,7 @@ use uuid::Uuid; use crate::{ client::Client, - packet_handling::game::{handle_send_packet_event, SendPacketEvent}, + packet_handling::game::{SendPacketEvent, handle_send_packet_event}, }; /// A chat packet, either a system message or a chat message. diff --git a/azalea-client/src/chunks.rs b/azalea-client/src/chunks.rs index 0267c164..67313757 100644 --- a/azalea-client/src/chunks.rs +++ b/azalea-client/src/chunks.rs @@ -19,11 +19,11 @@ use simdnbt::owned::BaseNbt; use tracing::{error, trace}; use crate::{ + InstanceHolder, interact::handle_block_interact_event, inventory::InventorySet, - packet_handling::game::{handle_send_packet_event, SendPacketEvent}, + packet_handling::game::{SendPacketEvent, handle_send_packet_event}, respawn::perform_respawn, - InstanceHolder, }; pub struct ChunkPlugin; diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 9de97cc1..2f7460f5 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -14,29 +14,29 @@ use azalea_core::{ tick::GameTick, }; use azalea_entity::{ + EntityPlugin, EntityUpdateSet, EyeHeight, LocalEntity, Position, indexing::{EntityIdIndex, EntityUuidIndex}, metadata::Health, - EntityPlugin, EntityUpdateSet, EyeHeight, LocalEntity, Position, }; use azalea_physics::PhysicsPlugin; use azalea_protocol::{ + ServerAddress, common::client_information::ClientInformation, connect::{Connection, ConnectionError, Proxy}, packets::{ - self, + self, ClientIntention, ConnectionProtocol, PROTOCOL_VERSION, Packet, config::{ClientboundConfigPacket, ServerboundConfigPacket}, game::ServerboundGamePacket, handshake::{ - s_intention::ServerboundIntention, ClientboundHandshakePacket, - ServerboundHandshakePacket, + ClientboundHandshakePacket, ServerboundHandshakePacket, + s_intention::ServerboundIntention, }, login::{ - s_hello::ServerboundHello, s_key::ServerboundKey, - s_login_acknowledged::ServerboundLoginAcknowledged, ClientboundLoginPacket, + ClientboundLoginPacket, s_hello::ServerboundHello, s_key::ServerboundKey, + s_login_acknowledged::ServerboundLoginAcknowledged, }, - ClientIntention, ConnectionProtocol, Packet, PROTOCOL_VERSION, }, - resolver, ServerAddress, + resolver, }; use azalea_world::{Instance, InstanceContainer, InstanceName, PartialInstance}; use bevy_app::{App, Plugin, PluginGroup, PluginGroupBuilder, Update}; @@ -61,6 +61,7 @@ use tracing::{debug, error}; use uuid::Uuid; use crate::{ + Account, PlayerInfo, attack::{self, AttackPlugin}, chat::ChatPlugin, chunks::{ChunkBatchInfo, ChunkPlugin}, @@ -70,21 +71,20 @@ use crate::{ interact::{CurrentSequenceNumber, InteractPlugin}, inventory::{Inventory, InventoryPlugin}, local_player::{ - death_event, GameProfileComponent, Hunger, InstanceHolder, PermissionLevel, - PlayerAbilities, TabList, + GameProfileComponent, Hunger, InstanceHolder, PermissionLevel, PlayerAbilities, TabList, + death_event, }, mining::{self, MinePlugin}, movement::{LastSentLookDirection, PhysicsState, PlayerMovePlugin}, packet_handling::{ - login::{self, InLoginState, LoginSendPacketQueue}, PacketHandlerPlugin, + login::{self, InLoginState, LoginSendPacketQueue}, }, player::retroactively_add_game_profile_component, raw_connection::RawConnection, respawn::RespawnPlugin, send_client_end::TickEndPlugin, task_pool::TaskPoolPlugin, - Account, PlayerInfo, }; /// `Client` has the things that a user interacting with the library will want. diff --git a/azalea-client/src/configuration.rs b/azalea-client/src/configuration.rs index 6f752bbd..d578be7a 100644 --- a/azalea-client/src/configuration.rs +++ b/azalea-client/src/configuration.rs @@ -44,7 +44,9 @@ fn handle_end_login_state( let client_information = match query.get(entity).ok() { Some(i) => i, None => { - warn!("ClientInformation component was not set before leaving login state, using a default"); + warn!( + "ClientInformation component was not set before leaving login state, using a default" + ); &ClientInformation::default() } }; diff --git a/azalea-client/src/disconnect.rs b/azalea-client/src/disconnect.rs index c653e195..a1eac971 100644 --- a/azalea-client/src/disconnect.rs +++ b/azalea-client/src/disconnect.rs @@ -1,7 +1,7 @@ //! Disconnect a client from the server. use azalea_chat::FormattedText; -use azalea_entity::{metadata::PlayerMetadataBundle, EntityBundle, LocalEntity}; +use azalea_entity::{EntityBundle, LocalEntity, metadata::PlayerMetadataBundle}; use bevy_app::{App, Plugin, PostUpdate}; use bevy_ecs::{ component::Component, @@ -16,8 +16,8 @@ use derive_more::Deref; use tracing::trace; use crate::{ - client::JoinedClientBundle, events::LocalPlayerEvents, raw_connection::RawConnection, - InstanceHolder, + InstanceHolder, client::JoinedClientBundle, events::LocalPlayerEvents, + raw_connection::RawConnection, }; pub struct DisconnectPlugin; diff --git a/azalea-client/src/events.rs b/azalea-client/src/events.rs index 372350bb..aed16bcb 100644 --- a/azalea-client/src/events.rs +++ b/azalea-client/src/events.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use azalea_chat::FormattedText; use azalea_core::tick::GameTick; use azalea_protocol::packets::game::{ - c_player_combat_kill::ClientboundPlayerCombatKill, ClientboundGamePacket, + ClientboundGamePacket, c_player_combat_kill::ClientboundPlayerCombatKill, }; use azalea_world::{InstanceName, MinecraftEntityId}; use bevy_app::{App, Plugin, PreUpdate, Update}; @@ -21,13 +21,13 @@ use derive_more::{Deref, DerefMut}; use tokio::sync::mpsc; use crate::{ + PlayerInfo, chat::{ChatPacket, ChatReceivedEvent}, disconnect::DisconnectEvent, packet_handling::game::{ AddPlayerEvent, DeathEvent, KeepAliveEvent, PacketEvent, RemovePlayerEvent, UpdatePlayerEvent, }, - PlayerInfo, }; // (for contributors): diff --git a/azalea-client/src/interact.rs b/azalea-client/src/interact.rs index e11873ae..fdeff197 100644 --- a/azalea-client/src/interact.rs +++ b/azalea-client/src/interact.rs @@ -8,9 +8,9 @@ use azalea_core::{ position::{BlockPos, Vec3}, }; use azalea_entity::{ - clamp_look_direction, view_vector, Attributes, EyeHeight, LocalEntity, LookDirection, Position, + Attributes, EyeHeight, LocalEntity, LookDirection, Position, clamp_look_direction, view_vector, }; -use azalea_inventory::{components, ItemStack, ItemStackData}; +use azalea_inventory::{ItemStack, ItemStackData, components}; use azalea_physics::clip::{BlockShapeType, ClipContext, FluidPickType}; use azalea_protocol::packets::game::{ s_interact::InteractionHand, @@ -31,13 +31,13 @@ use derive_more::{Deref, DerefMut}; use tracing::warn; use crate::{ + Client, attack::handle_attack_event, inventory::{Inventory, InventorySet}, local_player::{LocalGameMode, PermissionLevel, PlayerAbilities}, movement::MoveEventsSet, - packet_handling::game::{handle_send_packet_event, SendPacketEvent}, + packet_handling::game::{SendPacketEvent, handle_send_packet_event}, respawn::perform_respawn, - Client, }; /// A plugin that allows clients to interact with blocks in the world. @@ -245,15 +245,16 @@ pub fn check_is_interaction_restricted( // way of modifying that let held_item = inventory.held_item(); - if let ItemStack::Present(item) = &held_item { - let block = instance.chunks.get_block_state(block_pos); - let Some(block) = block else { - // block isn't loaded so just say that it is restricted - return true; - }; - check_block_can_be_broken_by_item_in_adventure_mode(item, &block) - } else { - true + match &held_item { + ItemStack::Present(item) => { + let block = instance.chunks.get_block_state(block_pos); + let Some(block) = block else { + // block isn't loaded so just say that it is restricted + return true; + }; + check_block_can_be_broken_by_item_in_adventure_mode(item, &block) + } + _ => true, } } GameMode::Spectator => true, diff --git a/azalea-client/src/inventory.rs b/azalea-client/src/inventory.rs index 2dd17853..4d796c9c 100644 --- a/azalea-client/src/inventory.rs +++ b/azalea-client/src/inventory.rs @@ -26,10 +26,10 @@ use bevy_ecs::{ use tracing::warn; use crate::{ + Client, local_player::PlayerAbilities, - packet_handling::game::{handle_send_packet_event, SendPacketEvent}, + packet_handling::game::{SendPacketEvent, handle_send_packet_event}, respawn::perform_respawn, - Client, }; pub struct InventoryPlugin; @@ -124,10 +124,9 @@ impl Inventory { /// /// Use [`Self::menu_mut`] if you need a mutable reference. pub fn menu(&self) -> &azalea_inventory::Menu { - if let Some(menu) = &self.container_menu { - menu - } else { - &self.inventory_menu + match &self.container_menu { + Some(menu) => menu, + _ => &self.inventory_menu, } } @@ -137,10 +136,9 @@ impl Inventory { /// /// Use [`Self::menu`] if you don't need a mutable reference. pub fn menu_mut(&mut self) -> &mut azalea_inventory::Menu { - if let Some(menu) = &mut self.container_menu { - menu - } else { - &mut self.inventory_menu + match &mut self.container_menu { + Some(menu) => menu, + _ => &mut self.inventory_menu, } } @@ -286,10 +284,9 @@ impl Inventory { carried_count -= new_carried.count - slot_item_count; // we have to inline self.menu_mut() here to avoid the borrow checker // complaining - let menu = if let Some(menu) = &mut self.container_menu { - menu - } else { - &mut self.inventory_menu + let menu = match &mut self.container_menu { + Some(menu) => menu, + _ => &mut self.inventory_menu, }; *menu.slot_mut(slot_index as usize).unwrap() = ItemStack::Present(new_carried); diff --git a/azalea-client/src/lib.rs b/azalea-client/src/lib.rs index d07e323d..abe7c692 100644 --- a/azalea-client/src/lib.rs +++ b/azalea-client/src/lib.rs @@ -35,8 +35,8 @@ pub mod test_simulation; pub use account::{Account, AccountOpts}; pub use azalea_protocol::common::client_information::ClientInformation; pub use client::{ - start_ecs_runner, Client, DefaultPlugins, InConfigState, JoinError, JoinedClientBundle, - LocalPlayerBundle, StartClientOpts, TickBroadcast, + Client, DefaultPlugins, InConfigState, JoinError, JoinedClientBundle, LocalPlayerBundle, + StartClientOpts, TickBroadcast, start_ecs_runner, }; pub use events::Event; pub use local_player::{GameProfileComponent, Hunger, InstanceHolder, TabList}; diff --git a/azalea-client/src/local_player.rs b/azalea-client/src/local_player.rs index 9939c47a..7e323f4c 100644 --- a/azalea-client/src/local_player.rs +++ b/azalea-client/src/local_player.rs @@ -14,8 +14,8 @@ use tracing::error; use uuid::Uuid; use crate::{ - events::{Event as AzaleaEvent, LocalPlayerEvents}, ClientInformation, PlayerInfo, + events::{Event as AzaleaEvent, LocalPlayerEvents}, }; /// A component that keeps strong references to our [`PartialInstance`] and diff --git a/azalea-client/src/mining.rs b/azalea-client/src/mining.rs index ac4c9c0d..03063b3e 100644 --- a/azalea-client/src/mining.rs +++ b/azalea-client/src/mining.rs @@ -1,6 +1,6 @@ -use azalea_block::{fluid_state::FluidState, Block, BlockState}; +use azalea_block::{Block, BlockState, fluid_state::FluidState}; use azalea_core::{direction::Direction, game_type::GameMode, position::BlockPos, tick::GameTick}; -use azalea_entity::{mining::get_mine_progress, FluidOnEyes, Physics}; +use azalea_entity::{FluidOnEyes, Physics, mining::get_mine_progress}; use azalea_inventory::ItemStack; use azalea_physics::PhysicsSet; use azalea_protocol::packets::game::s_player_action::{self, ServerboundPlayerAction}; @@ -10,15 +10,15 @@ use bevy_ecs::prelude::*; use derive_more::{Deref, DerefMut}; use crate::{ + Client, interact::{ - can_use_game_master_blocks, check_is_interaction_restricted, CurrentSequenceNumber, - HitResultComponent, SwingArmEvent, + CurrentSequenceNumber, HitResultComponent, SwingArmEvent, can_use_game_master_blocks, + check_is_interaction_restricted, }, inventory::{Inventory, InventorySet}, local_player::{LocalGameMode, PermissionLevel, PlayerAbilities}, movement::MoveEventsSet, packet_handling::game::SendPacketEvent, - Client, }; /// A plugin that allows clients to break blocks in the world. diff --git a/azalea-client/src/movement.rs b/azalea-client/src/movement.rs index 3bea9de2..b0ff70f4 100644 --- a/azalea-client/src/movement.rs +++ b/azalea-client/src/movement.rs @@ -2,18 +2,18 @@ use std::backtrace::Backtrace; use azalea_core::position::Vec3; use azalea_core::tick::GameTick; -use azalea_entity::{metadata::Sprinting, Attributes, Jumping}; +use azalea_entity::{Attributes, Jumping, metadata::Sprinting}; use azalea_entity::{InLoadedChunk, LastSentPosition, LookDirection, Physics, Position}; -use azalea_physics::{ai_step, PhysicsSet}; +use azalea_physics::{PhysicsSet, ai_step}; use azalea_protocol::packets::game::{ServerboundPlayerCommand, ServerboundPlayerInput}; use azalea_protocol::packets::{ + Packet, game::{ s_move_player_pos::ServerboundMovePlayerPos, s_move_player_pos_rot::ServerboundMovePlayerPosRot, s_move_player_rot::ServerboundMovePlayerRot, s_move_player_status_only::ServerboundMovePlayerStatusOnly, }, - Packet, }; use azalea_world::{MinecraftEntityId, MoveEntityError}; use bevy_app::{App, Plugin, Update}; diff --git a/azalea-client/src/packet_handling/configuration.rs b/azalea-client/src/packet_handling/configuration.rs index 9124f6aa..bfa6914b 100644 --- a/azalea-client/src/packet_handling/configuration.rs +++ b/azalea-client/src/packet_handling/configuration.rs @@ -14,12 +14,12 @@ use bevy_ecs::prelude::*; use bevy_ecs::system::SystemState; use tracing::{debug, error, warn}; +use crate::InstanceHolder; use crate::client::InConfigState; use crate::disconnect::DisconnectEvent; use crate::local_player::Hunger; use crate::packet_handling::game::KeepAliveEvent; use crate::raw_connection::RawConnection; -use crate::InstanceHolder; #[derive(Event, Debug, Clone)] pub struct ConfigurationEvent { diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index 73442804..6f2868e9 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -13,21 +13,22 @@ use azalea_core::{ resource_location::ResourceLocation, }; use azalea_entity::{ - indexing::{EntityIdIndex, EntityUuidIndex}, - metadata::{apply_metadata, Health}, Dead, EntityBundle, EntityKind, LastSentPosition, LoadedBy, LocalEntity, LookDirection, Physics, Position, RelativeEntityUpdate, + indexing::{EntityIdIndex, EntityUuidIndex}, + metadata::{Health, apply_metadata}, }; use azalea_protocol::{ packets::{ + Packet, game::{ + ClientboundGamePacket, ServerboundGamePacket, c_player_combat_kill::ClientboundPlayerCombatKill, s_accept_teleportation::ServerboundAcceptTeleportation, s_configuration_acknowledged::ServerboundConfigurationAcknowledged, s_keep_alive::ServerboundKeepAlive, s_move_player_pos_rot::ServerboundMovePlayerPosRot, - s_pong::ServerboundPong, ClientboundGamePacket, ServerboundGamePacket, + s_pong::ServerboundPong, }, - Packet, }, read::deserialize_packet, }; @@ -38,6 +39,7 @@ use tracing::{debug, error, trace, warn}; use uuid::Uuid; use crate::{ + ClientInformation, PlayerInfo, chat::{ChatPacket, ChatReceivedEvent}, chunks, disconnect::DisconnectEvent, @@ -49,7 +51,6 @@ use crate::{ }, movement::{KnockbackEvent, KnockbackType}, raw_connection::RawConnection, - ClientInformation, PlayerInfo, }; /// An event that's sent when we receive a packet. @@ -427,11 +428,7 @@ pub fn process_packet_events(ecs: &mut World) { **last_sent_position = **position; fn apply_change<T: Add<Output = T>>(base: T, condition: bool, change: T) -> T { - if condition { - base + change - } else { - change - } + if condition { base + change } else { change } } let new_x = apply_change(position.x, p.relative.x, p.change.pos.x); @@ -655,9 +652,13 @@ pub fn process_packet_events(ecs: &mut World) { let entity_in_ecs = entity_query.get(ecs_entity).is_ok(); if entity_in_ecs { - error!("LoadedBy for entity {entity_id:?} ({ecs_entity:?}) isn't in the ecs, but the entity is in entity_by_id"); + error!( + "LoadedBy for entity {entity_id:?} ({ecs_entity:?}) isn't in the ecs, but the entity is in entity_by_id" + ); } else { - error!("Entity {entity_id:?} ({ecs_entity:?}) isn't in the ecs, but the entity is in entity_by_id"); + error!( + "Entity {entity_id:?} ({ecs_entity:?}) isn't in the ecs, but the entity is in entity_by_id" + ); } continue; }; @@ -719,7 +720,10 @@ pub fn process_packet_events(ecs: &mut World) { let Some(entity) = entity else { // some servers like hypixel trigger this a lot :( - debug!("Server sent an entity data packet for an entity id ({}) that we don't know about", p.id); + debug!( + "Server sent an entity data packet for an entity id ({}) that we don't know about", + p.id + ); continue; }; let entity_kind = *entity_kind_query.get(entity).unwrap(); @@ -1035,7 +1039,9 @@ pub fn process_packet_events(ecs: &mut World) { for &id in &p.entity_ids { let Some(entity) = entity_id_index.remove(id) else { - debug!("Tried to remove entity with id {id} but it wasn't in the EntityIdIndex"); + debug!( + "Tried to remove entity with id {id} but it wasn't in the EntityIdIndex" + ); continue; }; let Ok(mut loaded_by) = entity_query.get_mut(entity) else { diff --git a/azalea-client/src/packet_handling/login.rs b/azalea-client/src/packet_handling/login.rs index dec4aa06..8cf45afc 100644 --- a/azalea-client/src/packet_handling/login.rs +++ b/azalea-client/src/packet_handling/login.rs @@ -4,11 +4,11 @@ use std::{collections::HashSet, sync::Arc}; use azalea_protocol::packets::{ + Packet, login::{ - s_custom_query_answer::ServerboundCustomQueryAnswer, ClientboundLoginPacket, - ServerboundLoginPacket, + ClientboundLoginPacket, ServerboundLoginPacket, + s_custom_query_answer::ServerboundCustomQueryAnswer, }, - Packet, }; use bevy_ecs::{prelude::*, system::SystemState}; use derive_more::{Deref, DerefMut}; diff --git a/azalea-client/src/packet_handling/mod.rs b/azalea-client/src/packet_handling/mod.rs index 6bb9c319..908f368e 100644 --- a/azalea-client/src/packet_handling/mod.rs +++ b/azalea-client/src/packet_handling/mod.rs @@ -1,4 +1,4 @@ -use azalea_entity::{metadata::Health, EntityUpdateSet}; +use azalea_entity::{EntityUpdateSet, metadata::Health}; use bevy_app::{App, First, Plugin, PreUpdate, Update}; use bevy_ecs::prelude::*; diff --git a/azalea-client/src/ping.rs b/azalea-client/src/ping.rs index f5d714cd..38d5c26f 100755 --- a/azalea-client/src/ping.rs +++ b/azalea-client/src/ping.rs @@ -3,19 +3,20 @@ use std::io; use azalea_protocol::{ + ServerAddress, connect::{Connection, ConnectionError, Proxy}, packets::{ + ClientIntention, PROTOCOL_VERSION, handshake::{ - s_intention::ServerboundIntention, ClientboundHandshakePacket, - ServerboundHandshakePacket, + ClientboundHandshakePacket, ServerboundHandshakePacket, + s_intention::ServerboundIntention, }, status::{ - c_status_response::ClientboundStatusResponse, - s_status_request::ServerboundStatusRequest, ClientboundStatusPacket, + ClientboundStatusPacket, c_status_response::ClientboundStatusResponse, + s_status_request::ServerboundStatusRequest, }, - ClientIntention, PROTOCOL_VERSION, }, - resolver, ServerAddress, + resolver, }; use thiserror::Error; diff --git a/azalea-client/src/player.rs b/azalea-client/src/player.rs index 9289d260..f0641cf1 100755 --- a/azalea-client/src/player.rs +++ b/azalea-client/src/player.rs @@ -8,7 +8,7 @@ use bevy_ecs::{ }; use uuid::Uuid; -use crate::{packet_handling::game::AddPlayerEvent, GameProfileComponent}; +use crate::{GameProfileComponent, packet_handling::game::AddPlayerEvent}; /// A player in the tab list. #[derive(Debug, Clone)] diff --git a/azalea-client/src/respawn.rs b/azalea-client/src/respawn.rs index edd2a43a..41d1c470 100644 --- a/azalea-client/src/respawn.rs +++ b/azalea-client/src/respawn.rs @@ -2,7 +2,7 @@ use azalea_protocol::packets::game::s_client_command::{self, ServerboundClientCo use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::*; -use crate::packet_handling::game::{handle_send_packet_event, SendPacketEvent}; +use crate::packet_handling::game::{SendPacketEvent, handle_send_packet_event}; /// Tell the server that we're respawning. #[derive(Event, Debug, Clone)] diff --git a/azalea-client/src/task_pool.rs b/azalea-client/src/task_pool.rs index d4963cd5..ab56bf69 100644 --- a/azalea-client/src/task_pool.rs +++ b/azalea-client/src/task_pool.rs @@ -5,8 +5,8 @@ use std::marker::PhantomData; use bevy_app::{App, Last, Plugin}; use bevy_ecs::system::{NonSend, Resource}; use bevy_tasks::{ - tick_global_task_pools_on_main_thread, AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool, - TaskPoolBuilder, + AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool, TaskPoolBuilder, + tick_global_task_pools_on_main_thread, }; /// Setup of default task pools: `AsyncComputeTaskPool`, `ComputeTaskPool`, diff --git a/azalea-client/src/test_simulation.rs b/azalea-client/src/test_simulation.rs index 5afd8b00..38cfbc15 100644 --- a/azalea-client/src/test_simulation.rs +++ b/azalea-client/src/test_simulation.rs @@ -25,9 +25,9 @@ use tokio::{sync::mpsc, time::sleep}; use uuid::Uuid; use crate::{ + ClientInformation, GameProfileComponent, InConfigState, InstanceHolder, LocalPlayerBundle, events::LocalPlayerEvents, raw_connection::{RawConnection, RawConnectionReader, RawConnectionWriter}, - ClientInformation, GameProfileComponent, InConfigState, InstanceHolder, LocalPlayerBundle, }; /// A way to simulate a client in a server, used for some internal tests. diff --git a/azalea-client/tests/change_dimension_to_nether_and_back.rs b/azalea-client/tests/change_dimension_to_nether_and_back.rs index 3ed623ef..16febca0 100644 --- a/azalea-client/tests/change_dimension_to_nether_and_back.rs +++ b/azalea-client/tests/change_dimension_to_nether_and_back.rs @@ -1,10 +1,10 @@ -use azalea_client::{test_simulation::*, InConfigState}; +use azalea_client::{InConfigState, test_simulation::*}; use azalea_core::{position::ChunkPos, resource_location::ResourceLocation}; -use azalea_entity::{metadata::Health, LocalEntity}; +use azalea_entity::{LocalEntity, metadata::Health}; use azalea_protocol::packets::{ + ConnectionProtocol, config::{ClientboundFinishConfiguration, ClientboundRegistryData}, game::ClientboundSetHealth, - ConnectionProtocol, }; use azalea_registry::DimensionType; use azalea_world::InstanceName; diff --git a/azalea-client/tests/set_health_before_login.rs b/azalea-client/tests/set_health_before_login.rs index d6b6c426..c078cae4 100644 --- a/azalea-client/tests/set_health_before_login.rs +++ b/azalea-client/tests/set_health_before_login.rs @@ -1,10 +1,10 @@ -use azalea_client::{test_simulation::*, InConfigState}; +use azalea_client::{InConfigState, test_simulation::*}; use azalea_core::resource_location::ResourceLocation; -use azalea_entity::{metadata::Health, LocalEntity}; +use azalea_entity::{LocalEntity, metadata::Health}; use azalea_protocol::packets::{ + ConnectionProtocol, config::{ClientboundFinishConfiguration, ClientboundRegistryData}, game::ClientboundSetHealth, - ConnectionProtocol, }; use azalea_registry::DimensionType; use bevy_log::tracing_subscriber; |
