diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-07-09 19:11:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-09 19:11:29 -0500 |
| commit | d1afd02aa84e7b4450c1607277f078eb2a0f1bf3 (patch) | |
| tree | efea9bb7ef7f2064f7c963fd88f394fecec6231b /azalea/src/swarm/chat.rs | |
| parent | ea8a8fccb6eb39c97f6cb69e11db5f7d0886172e (diff) | |
| download | azalea-drasl-d1afd02aa84e7b4450c1607277f078eb2a0f1bf3.tar.xz | |
Update to Bevy 0.11 (#94)
* update to bevy 0.11
* clippy
---------
Co-authored-by: mat <git@matdoes.dev>
Diffstat (limited to 'azalea/src/swarm/chat.rs')
| -rw-r--r-- | azalea/src/swarm/chat.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/azalea/src/swarm/chat.rs b/azalea/src/swarm/chat.rs index 303ce35b..6cf4d6b6 100644 --- a/azalea/src/swarm/chat.rs +++ b/azalea/src/swarm/chat.rs @@ -20,7 +20,8 @@ use crate::ecs::{ system::{Commands, Query, Res, ResMut, Resource}, }; use azalea_client::chat::{ChatPacket, ChatReceivedEvent}; -use bevy_app::{App, Plugin}; +use bevy_app::{App, Plugin, Update}; +use bevy_ecs::prelude::Event; use std::collections::VecDeque; use super::{Swarm, SwarmEvent}; @@ -30,7 +31,10 @@ pub struct SwarmChatPlugin; impl Plugin for SwarmChatPlugin { fn build(&self, app: &mut App) { app.add_event::<NewChatMessageEvent>() - .add_systems((chat_listener, update_min_index_and_shrink_queue).chain()) + .add_systems( + Update, + (chat_listener, update_min_index_and_shrink_queue).chain(), + ) .insert_resource(GlobalChatState { chat_queue: VecDeque::new(), chat_min_index: 0, @@ -44,7 +48,7 @@ pub struct ClientChatState { } /// A chat message that no other bots have seen yet was received by a bot. -#[derive(Debug)] +#[derive(Event, Debug)] pub struct NewChatMessageEvent(ChatPacket); #[derive(Resource)] @@ -160,7 +164,10 @@ mod tests { // event mangement in drain_events app.init_resource::<Events<ChatReceivedEvent>>() .init_resource::<Events<NewChatMessageEvent>>() - .add_systems((chat_listener, update_min_index_and_shrink_queue).chain()) + .add_systems( + Update, + (chat_listener, update_min_index_and_shrink_queue).chain(), + ) .insert_resource(GlobalChatState { chat_queue: VecDeque::new(), chat_min_index: 0, |
