diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-03-07 14:14:36 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-07 14:14:36 -0600 |
| commit | 719379a8a76ab0685f2bd14bebe2f0cd1e97f06b (patch) | |
| tree | ce5d6c62bc36fb1d1ec31083bc8e81a0109c12df /azalea/src/swarm/chat.rs | |
| parent | bf4ff517890cad3ff4e36b4b78959504192e5374 (diff) | |
| download | azalea-drasl-719379a8a76ab0685f2bd14bebe2f0cd1e97f06b.tar.xz | |
Bevy 0.10 (#79)
* replace 0.9.1 with 0.10.0
* start migrating to bevy .10
* well it compiles
* doesn't immediately panic
* remove unused imports
* fmt
* delete azalea-ecs
* make RelativeEntityUpdate an EntityCommand
* fix a doc test
* explain what FixedUpdate does
Diffstat (limited to 'azalea/src/swarm/chat.rs')
| -rw-r--r-- | azalea/src/swarm/chat.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/azalea/src/swarm/chat.rs b/azalea/src/swarm/chat.rs index 18c27cd6..303ce35b 100644 --- a/azalea/src/swarm/chat.rs +++ b/azalea/src/swarm/chat.rs @@ -13,14 +13,14 @@ // in Swarm that's set to the smallest index of all the bots, and we remove all // messages from the queue that are before that index. -use azalea_client::chat::{ChatPacket, ChatReceivedEvent}; -use azalea_ecs::{ - app::{App, Plugin}, +use crate::ecs::{ component::Component, event::{EventReader, EventWriter}, - schedule::IntoSystemDescriptor, + schedule::IntoSystemConfigs, system::{Commands, Query, Res, ResMut, Resource}, }; +use azalea_client::chat::{ChatPacket, ChatReceivedEvent}; +use bevy_app::{App, Plugin}; use std::collections::VecDeque; use super::{Swarm, SwarmEvent}; @@ -30,8 +30,7 @@ pub struct SwarmChatPlugin; impl Plugin for SwarmChatPlugin { fn build(&self, app: &mut App) { app.add_event::<NewChatMessageEvent>() - .add_system(chat_listener.label("chat_listener")) - .add_system(update_min_index_and_shrink_queue.after("chat_listener")) + .add_systems((chat_listener, update_min_index_and_shrink_queue).chain()) .insert_resource(GlobalChatState { chat_queue: VecDeque::new(), chat_min_index: 0, @@ -151,7 +150,7 @@ fn update_min_index_and_shrink_queue( #[cfg(test)] mod tests { - use azalea_ecs::{ecs::Ecs, event::Events, system::SystemState}; + use bevy_ecs::{event::Events, prelude::World, system::SystemState}; use super::*; @@ -161,8 +160,7 @@ mod tests { // event mangement in drain_events app.init_resource::<Events<ChatReceivedEvent>>() .init_resource::<Events<NewChatMessageEvent>>() - .add_system(chat_listener.label("chat_listener")) - .add_system(update_min_index_and_shrink_queue.after("chat_listener")) + .add_systems((chat_listener, update_min_index_and_shrink_queue).chain()) .insert_resource(GlobalChatState { chat_queue: VecDeque::new(), chat_min_index: 0, @@ -170,7 +168,7 @@ mod tests { app } - fn drain_events(ecs: &mut Ecs) -> Vec<ChatPacket> { + fn drain_events(ecs: &mut World) -> Vec<ChatPacket> { let mut system_state: SystemState<ResMut<Events<NewChatMessageEvent>>> = SystemState::new(ecs); let mut events = system_state.get_mut(ecs); |
