aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/client_impl/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea/src/client_impl/mod.rs')
-rw-r--r--azalea/src/client_impl/mod.rs12
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)
}