aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/client_impl
diff options
context:
space:
mode:
Diffstat (limited to 'azalea/src/client_impl')
-rw-r--r--azalea/src/client_impl/mod.rs12
-rw-r--r--azalea/src/client_impl/movement.rs2
2 files changed, 11 insertions, 3 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)
}
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)
}