diff options
| author | mat <git@matdoes.dev> | 2025-09-28 13:10:04 -0545 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-09-28 13:10:04 -0545 |
| commit | 2c8b7c5c2c9297273abfba8f7743f1bc25f166b1 (patch) | |
| tree | 3d3aded400100c136287fa59293ce26c61644d00 /azalea-client/src/plugins/disconnect.rs | |
| parent | e2ed19c1ed92f0dccc881d835d9ac6e0f7f834c0 (diff) | |
| download | azalea-drasl-2c8b7c5c2c9297273abfba8f7743f1bc25f166b1.tar.xz | |
upgrade bevy to 0.17.0-rc.2
Diffstat (limited to 'azalea-client/src/plugins/disconnect.rs')
| -rw-r--r-- | azalea-client/src/plugins/disconnect.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea-client/src/plugins/disconnect.rs b/azalea-client/src/plugins/disconnect.rs index 3cb9e82a..95950ae9 100644 --- a/azalea-client/src/plugins/disconnect.rs +++ b/azalea-client/src/plugins/disconnect.rs @@ -19,7 +19,7 @@ use crate::{ pub struct DisconnectPlugin; impl Plugin for DisconnectPlugin { fn build(&self, app: &mut App) { - app.add_event::<DisconnectEvent>().add_systems( + app.add_message::<DisconnectEvent>().add_systems( PostUpdate, ( update_read_packets_task_running_component, @@ -45,7 +45,7 @@ impl Plugin for DisconnectPlugin { /// /// [`ConnectionFailedEvent`]: crate::join::ConnectionFailedEvent -#[derive(Event)] +#[derive(Message)] pub struct DisconnectEvent { pub entity: Entity, pub reason: Option<FormattedText>, @@ -82,7 +82,7 @@ pub struct RemoveOnDisconnectBundle { /// a [`DisconnectEvent`]. pub fn remove_components_from_disconnected_players( mut commands: Commands, - mut events: EventReader<DisconnectEvent>, + mut events: MessageReader<DisconnectEvent>, mut loaded_by_query: Query<&mut azalea_entity::LoadedBy>, ) { for DisconnectEvent { entity, reason } in events.read() { @@ -125,7 +125,7 @@ fn update_read_packets_task_running_component( #[allow(clippy::type_complexity)] fn disconnect_on_connection_dead( query: Query<(Entity, &IsConnectionAlive), (Changed<IsConnectionAlive>, With<LocalEntity>)>, - mut disconnect_events: EventWriter<DisconnectEvent>, + mut disconnect_events: MessageWriter<DisconnectEvent>, ) { for (entity, &is_connection_alive) in &query { if !*is_connection_alive { |
