diff options
| author | mat <git@matdoes.dev> | 2025-08-20 06:42:26 -1300 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-08-20 22:42:40 +0300 |
| commit | 63f15353e7c92c47b48df3aad7fa5c67012637c0 (patch) | |
| tree | 0b7556cd3c80935fd8e323f0f11673857cb6ef46 /azalea-client/src/client.rs | |
| parent | a89cae5703abe0e103a17e9c931fb6132c448172 (diff) | |
| download | azalea-drasl-63f15353e7c92c47b48df3aad7fa5c67012637c0.tar.xz | |
split client information handling out of BrandPlugin and some other cleanup
Diffstat (limited to 'azalea-client/src/client.rs')
| -rw-r--r-- | azalea-client/src/client.rs | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index be9c8e99..884d8c20 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -22,12 +22,8 @@ use azalea_entity::{ use azalea_physics::local_player::PhysicsState; use azalea_protocol::{ ServerAddress, - common::client_information::ClientInformation, connect::Proxy, - packets::{ - Packet, - game::{self, ServerboundGamePacket}, - }, + packets::{Packet, game::ServerboundGamePacket}, resolver, }; use azalea_world::{Instance, InstanceContainer, InstanceName, MinecraftEntityId, PartialInstance}; @@ -43,7 +39,7 @@ use tokio::{ sync::mpsc::{self}, time, }; -use tracing::{debug, error, info, warn}; +use tracing::{error, info, warn}; use uuid::Uuid; use crate::{ @@ -378,39 +374,6 @@ impl Client { self.query::<Option<&InstanceName>>(&mut self.ecs.lock()) .is_some() } - - /// Tell the server we changed our game options (i.e. render distance, main - /// hand). If this is not set before the login packet, the default will - /// be sent. - /// - /// ```rust,no_run - /// # use azalea_client::{Client, ClientInformation}; - /// # async fn example(bot: Client) -> Result<(), Box<dyn std::error::Error>> { - /// bot.set_client_information(ClientInformation { - /// view_distance: 2, - /// ..Default::default() - /// }) - /// .await; - /// # Ok(()) - /// # } - /// ``` - pub async fn set_client_information(&self, client_information: ClientInformation) { - { - let mut ecs = self.ecs.lock(); - let mut client_information_mut = self.query::<&mut ClientInformation>(&mut ecs); - *client_information_mut = client_information.clone(); - } - - if self.logged_in() { - debug!( - "Sending client information (already logged in): {:?}", - client_information - ); - self.write_packet(game::s_client_information::ServerboundClientInformation { - client_information, - }); - } - } } impl Client { |
