From 7ab3b8924f64f7eadb6b8928b6fae73cb06e4c2f Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 28 Dec 2025 14:31:41 +0500 Subject: move Event and auto_reconnect to the azalea crate --- azalea/src/client_impl/mod.rs | 12 ++++++++++-- azalea/src/client_impl/movement.rs | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'azalea/src/client_impl') diff --git a/azalea/src/client_impl/mod.rs b/azalea/src/client_impl/mod.rs index 2f5fbf7d..36995656 100644 --- a/azalea/src/client_impl/mod.rs +++ b/azalea/src/client_impl/mod.rs @@ -2,7 +2,7 @@ use std::{collections::HashMap, sync::Arc}; use azalea_auth::game_profile::GameProfile; use azalea_client::{ - Account, DefaultPlugins, Event, + Account, DefaultPlugins, connection::RawConnection, disconnect::DisconnectEvent, join::{ConnectOpts, StartJoinServerEvent}, @@ -40,6 +40,8 @@ use parking_lot::{Mutex, RwLock}; use tokio::sync::mpsc; use uuid::Uuid; +use crate::events::{Event, LocalPlayerEvents}; + pub mod attack; pub mod chat; pub mod client_information; @@ -210,7 +212,6 @@ impl Client { ecs_lock.lock().write_message(StartJoinServerEvent { account, connect_opts, - event_sender, start_join_callback_tx: Some(start_join_callback_tx), }); @@ -218,6 +219,13 @@ impl Client { "start_join_callback should not be dropped before sending a message, this is a bug in Azalea", ); + if let Some(event_sender) = event_sender { + ecs_lock + .lock() + .entity_mut(entity) + .insert(LocalPlayerEvents(event_sender)); + } + Client::new(entity, ecs_lock) } diff --git a/azalea/src/client_impl/movement.rs b/azalea/src/client_impl/movement.rs index 08624263..b47da9a7 100644 --- a/azalea/src/client_impl/movement.rs +++ b/azalea/src/client_impl/movement.rs @@ -28,7 +28,7 @@ impl Client { /// Whether the client is currently trying to sneak. /// - /// You may want to check the [`Pose`] instead. + /// You may want to check the [`Pose`](azalea_entity::Pose) instead. pub fn crouching(&self) -> bool { self.query_self::<&PhysicsState, _>(|p| p.trying_to_crouch) } -- cgit v1.2.3