diff options
Diffstat (limited to 'azalea-client/src/disconnect.rs')
| -rw-r--r-- | azalea-client/src/disconnect.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/azalea-client/src/disconnect.rs b/azalea-client/src/disconnect.rs index 3b8d133e..10aef7ba 100644 --- a/azalea-client/src/disconnect.rs +++ b/azalea-client/src/disconnect.rs @@ -1,10 +1,11 @@ //! Disconnect a client from the server. -use bevy_app::{App, CoreSet, Plugin}; +use bevy_app::{App, Plugin, PostUpdate}; use bevy_ecs::{ component::Component, entity::Entity, event::{EventReader, EventWriter}, + prelude::Event, query::Changed, schedule::IntoSystemConfigs, system::{Commands, Query}, @@ -17,18 +18,19 @@ pub struct DisconnectPlugin; impl Plugin for DisconnectPlugin { fn build(&self, app: &mut App) { app.add_event::<DisconnectEvent>().add_systems( + PostUpdate, ( update_read_packets_task_running_component, disconnect_on_read_packets_ended, remove_components_from_disconnected_players, ) - .in_base_set(CoreSet::PostUpdate) .chain(), ); } } /// An event sent when a client is getting disconnected. +#[derive(Event)] pub struct DisconnectEvent { pub entity: Entity, } |
