From 2c8b7c5c2c9297273abfba8f7743f1bc25f166b1 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 28 Sep 2025 13:10:04 -0545 Subject: upgrade bevy to 0.17.0-rc.2 --- azalea-client/src/plugins/chat/handler.rs | 4 ++-- azalea-client/src/plugins/chat/mod.rs | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'azalea-client/src/plugins/chat') diff --git a/azalea-client/src/plugins/chat/handler.rs b/azalea-client/src/plugins/chat/handler.rs index a289eb14..d71bcbd1 100644 --- a/azalea-client/src/plugins/chat/handler.rs +++ b/azalea-client/src/plugins/chat/handler.rs @@ -21,7 +21,7 @@ use crate::{Account, chat_signing::ChatSigningSession, packet::game::SendPacketE /// preserved if multiple chat messages and commands are sent at the same time. /// /// [`SendChatEvent`]: super::SendChatEvent -#[derive(Event)] +#[derive(Message)] pub struct SendChatKindEvent { pub entity: Entity, pub content: String, @@ -29,7 +29,7 @@ pub struct SendChatKindEvent { } pub fn handle_send_chat_kind_event( - mut events: EventReader, + mut events: MessageReader, mut commands: Commands, mut query: Query<(&Account, &mut ChatSigningSession)>, ) { diff --git a/azalea-client/src/plugins/chat/mod.rs b/azalea-client/src/plugins/chat/mod.rs index f8ef3251..098b6543 100644 --- a/azalea-client/src/plugins/chat/mod.rs +++ b/azalea-client/src/plugins/chat/mod.rs @@ -19,9 +19,9 @@ use crate::client::Client; pub struct ChatPlugin; impl Plugin for ChatPlugin { fn build(&self, app: &mut App) { - app.add_event::() - .add_event::() - .add_event::() + app.add_message::() + .add_message::() + .add_message::() .add_systems( Update, (handle_send_chat_event, handle_send_chat_kind_event).chain(), @@ -189,7 +189,7 @@ impl Client { /// handles checking whether the message is a command and using the /// proper packet for you, so you should use that instead. pub fn write_chat_packet(&self, message: &str) { - self.ecs.lock().send_event(SendChatKindEvent { + self.ecs.lock().write_message(SendChatKindEvent { entity: self.entity, content: message.to_string(), kind: ChatKind::Message, @@ -202,7 +202,7 @@ impl Client { /// You can also just use [`Client::chat`] and start your message with a `/` /// to send a command. pub fn write_command_packet(&self, command: &str) { - self.ecs.lock().send_event(SendChatKindEvent { + self.ecs.lock().write_message(SendChatKindEvent { entity: self.entity, content: command.to_string(), kind: ChatKind::Command, @@ -219,7 +219,7 @@ impl Client { /// # } /// ``` pub fn chat(&self, content: impl Into) { - self.ecs.lock().send_event(SendChatEvent { + self.ecs.lock().write_message(SendChatEvent { entity: self.entity, content: content.into(), }); @@ -227,22 +227,22 @@ impl Client { } /// A client received a chat message packet. -#[derive(Event, Debug, Clone)] +#[derive(Message, 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)] +#[derive(Message)] pub struct SendChatEvent { pub entity: Entity, pub content: String, } pub fn handle_send_chat_event( - mut events: EventReader, - mut send_chat_kind_events: EventWriter, + mut events: MessageReader, + mut send_chat_kind_events: MessageWriter, ) { for event in events.read() { if event.content.starts_with('/') { -- cgit v1.2.3