aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/chat.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2023-07-09 19:11:29 -0500
committerGitHub <noreply@github.com>2023-07-09 19:11:29 -0500
commitd1afd02aa84e7b4450c1607277f078eb2a0f1bf3 (patch)
treeefea9bb7ef7f2064f7c963fd88f394fecec6231b /azalea-client/src/chat.rs
parentea8a8fccb6eb39c97f6cb69e11db5f7d0886172e (diff)
downloadazalea-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-client/src/chat.rs')
-rwxr-xr-xazalea-client/src/chat.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs
index 90618c80..337bce51 100755
--- a/azalea-client/src/chat.rs
+++ b/azalea-client/src/chat.rs
@@ -7,11 +7,12 @@ use azalea_protocol::packets::game::{
serverbound_chat_command_packet::ServerboundChatCommandPacket,
serverbound_chat_packet::{LastSeenMessagesUpdate, ServerboundChatPacket},
};
-use bevy_app::{App, Plugin};
+use bevy_app::{App, Plugin, Update};
use bevy_ecs::{
entity::Entity,
event::{EventReader, EventWriter},
- schedule::{IntoSystemConfig, IntoSystemConfigs},
+ prelude::Event,
+ schedule::IntoSystemConfigs,
};
use std::{
sync::Arc,
@@ -170,6 +171,7 @@ impl Plugin for ChatPlugin {
.add_event::<SendChatKindEvent>()
.add_event::<ChatReceivedEvent>()
.add_systems(
+ Update,
(
handle_send_chat_event,
handle_send_chat_kind_event.after(handle_send_packet_event),
@@ -180,13 +182,14 @@ impl Plugin for ChatPlugin {
}
/// A client received a chat message packet.
-#[derive(Debug, Clone)]
+#[derive(Event, Debug, Clone)]
pub struct ChatReceivedEvent {
pub entity: Entity,
pub packet: ChatPacket,
}
/// Send a chat message (or command, if it starts with a slash) to the server.
+#[derive(Event)]
pub struct SendChatEvent {
pub entity: Entity,
pub content: String,
@@ -222,6 +225,7 @@ fn handle_send_chat_event(
///
/// If you're wondering why this isn't two separate events, it's so ordering is
/// preserved if multiple chat messages and commands are sent at the same time.
+#[derive(Event)]
pub struct SendChatKindEvent {
pub entity: Entity,
pub content: String,