diff options
| author | mat <git@matdoes.dev> | 2025-12-28 14:31:41 +0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-12-28 14:31:41 +0500 |
| commit | 7ab3b8924f64f7eadb6b8928b6fae73cb06e4c2f (patch) | |
| tree | 5add5d27fd7c2638ebe6fab9bd7adcdae28a358d /azalea/src/client_impl/mod.rs | |
| parent | 9513f42e87f64c409cdb2a100500a50e5a713bac (diff) | |
| download | azalea-drasl-7ab3b8924f64f7eadb6b8928b6fae73cb06e4c2f.tar.xz | |
move Event and auto_reconnect to the azalea crate
Diffstat (limited to 'azalea/src/client_impl/mod.rs')
| -rw-r--r-- | azalea/src/client_impl/mod.rs | 12 |
1 files changed, 10 insertions, 2 deletions
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) } |
