diff options
| author | mat <git@matdoes.dev> | 2026-03-28 15:07:52 -1100 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2026-03-28 15:07:52 -1100 |
| commit | 7b7b12223205d5df21a31ae8e6fcd7ad69bd7cb4 (patch) | |
| tree | 0bd58b95d1247fc9044a0e5ed65a7a6b4f8f3c1d | |
| parent | ed12c2dd3608588cc5a6c1ee250735bb0414de7f (diff) | |
| download | azalea-drasl-7b7b12223205d5df21a31ae8e6fcd7ad69bd7cb4.tar.xz | |
re-export azalea-chat from azalea, and rename azalea::chat to client_chat
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | azalea-chat/src/component.rs | 10 | ||||
| -rw-r--r-- | azalea-chat/src/text_component.rs | 6 | ||||
| -rw-r--r-- | azalea-chat/src/translatable_component.rs | 5 | ||||
| -rw-r--r-- | azalea-client/src/plugins/chat_signing.rs | 4 | ||||
| -rw-r--r-- | azalea-client/src/plugins/client_chat/handler.rs (renamed from azalea-client/src/plugins/chat/handler.rs) | 0 | ||||
| -rw-r--r-- | azalea-client/src/plugins/client_chat/mod.rs (renamed from azalea-client/src/plugins/chat/mod.rs) | 0 | ||||
| -rw-r--r-- | azalea-client/src/plugins/mod.rs | 4 | ||||
| -rw-r--r-- | azalea-client/src/plugins/packet/game/mod.rs | 2 | ||||
| -rw-r--r-- | azalea-client/src/plugins/packet/mod.rs | 2 | ||||
| -rw-r--r-- | azalea/examples/testbot/commands.rs | 2 | ||||
| -rw-r--r-- | azalea/src/client_impl/chat.rs | 2 | ||||
| -rw-r--r-- | azalea/src/events.rs | 2 | ||||
| -rw-r--r-- | azalea/src/lib.rs | 1 | ||||
| -rw-r--r-- | azalea/src/pathfinder/debug.rs | 2 | ||||
| -rw-r--r-- | azalea/src/swarm/chat.rs | 2 | ||||
| -rw-r--r-- | azalea/src/swarm/mod.rs | 2 |
17 files changed, 26 insertions, 22 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ae9268fa..f5371705 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ is breaking anyways, semantic versioning is not followed. ### Changed +- Re-export `azalea-chat` from `azalea`, and move the other `azalea::chat` module to `azalea::client_chat`. + ### Fixed ## [0.16.0+mc26.1] - 2026-03-27 diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index b338fe2d..90906bfd 100644 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -674,16 +674,6 @@ impl From<&str> for FormattedText { Self::from(s.to_owned()) } } -impl From<TranslatableComponent> for FormattedText { - fn from(c: TranslatableComponent) -> Self { - FormattedText::Translatable(c) - } -} -impl From<TextComponent> for FormattedText { - fn from(c: TextComponent) -> Self { - FormattedText::Text(c) - } -} impl Display for FormattedText { /// Render the text in the component but without any formatting/styling. diff --git a/azalea-chat/src/text_component.rs b/azalea-chat/src/text_component.rs index 41f03965..78270bd8 100644 --- a/azalea-chat/src/text_component.rs +++ b/azalea-chat/src/text_component.rs @@ -164,6 +164,12 @@ impl Display for TextComponent { } } +impl From<TextComponent> for FormattedText { + fn from(c: TextComponent) -> Self { + FormattedText::Text(c) + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/azalea-chat/src/translatable_component.rs b/azalea-chat/src/translatable_component.rs index a846b550..b745f7d3 100644 --- a/azalea-chat/src/translatable_component.rs +++ b/azalea-chat/src/translatable_component.rs @@ -237,6 +237,11 @@ impl From<&str> for TranslatableComponent { TranslatableComponent::new(s.to_owned(), vec![]) } } +impl From<TranslatableComponent> for FormattedText { + fn from(c: TranslatableComponent) -> Self { + FormattedText::Translatable(c) + } +} #[cfg(test)] mod tests { diff --git a/azalea-client/src/plugins/chat_signing.rs b/azalea-client/src/plugins/chat_signing.rs index 2de9c6b0..a0404636 100644 --- a/azalea-client/src/plugins/chat_signing.rs +++ b/azalea-client/src/plugins/chat_signing.rs @@ -12,7 +12,7 @@ use chrono::Utc; use tracing::{debug, error}; use uuid::Uuid; -use super::{chat, login::IsAuthenticated, packet::game::SendGamePacketEvent}; +use super::{client_chat, login::IsAuthenticated, packet::game::SendGamePacketEvent}; use crate::{InGameState, account::Account}; pub struct ChatSigningPlugin; @@ -26,7 +26,7 @@ impl Plugin for ChatSigningPlugin { handle_queued_certs_to_send, ) .chain() - .before(chat::handler::handle_send_chat_kind_event), + .before(client_chat::handler::handle_send_chat_kind_event), ); } } diff --git a/azalea-client/src/plugins/chat/handler.rs b/azalea-client/src/plugins/client_chat/handler.rs index 703a9846..703a9846 100644 --- a/azalea-client/src/plugins/chat/handler.rs +++ b/azalea-client/src/plugins/client_chat/handler.rs diff --git a/azalea-client/src/plugins/chat/mod.rs b/azalea-client/src/plugins/client_chat/mod.rs index ca247ec4..ca247ec4 100644 --- a/azalea-client/src/plugins/chat/mod.rs +++ b/azalea-client/src/plugins/client_chat/mod.rs diff --git a/azalea-client/src/plugins/mod.rs b/azalea-client/src/plugins/mod.rs index 35e26f9e..b1fb01ac 100644 --- a/azalea-client/src/plugins/mod.rs +++ b/azalea-client/src/plugins/mod.rs @@ -3,10 +3,10 @@ use bevy_app::{PluginGroup, PluginGroupBuilder}; pub mod attack; pub mod block_update; pub mod brand; -pub mod chat; #[cfg(feature = "online-mode")] pub mod chat_signing; pub mod chunks; +pub mod client_chat; pub mod client_information; pub mod connection; pub mod cookies; @@ -41,7 +41,7 @@ impl PluginGroup for DefaultPlugins { .add(azalea_physics::PhysicsPlugin) .add(task_pool::TaskPoolPlugin::default()) .add(inventory::InventoryPlugin) - .add(chat::ChatPlugin) + .add(client_chat::ChatPlugin) .add(disconnect::DisconnectPlugin) .add(movement::MovementPlugin) .add(interact::InteractPlugin) diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs index f1bff086..26e98ae5 100644 --- a/azalea-client/src/plugins/packet/game/mod.rs +++ b/azalea-client/src/plugins/packet/game/mod.rs @@ -32,8 +32,8 @@ use tracing::{debug, error, warn}; use crate::{ ClientInformation, block_update::QueuedServerBlockUpdates, - chat::{ChatPacket, ChatReceivedEvent}, chunks, + client_chat::{ChatPacket, ChatReceivedEvent}, connection::RawConnection, cookies::{RequestCookieEvent, StoreCookieEvent}, disconnect::DisconnectEvent, diff --git a/azalea-client/src/plugins/packet/mod.rs b/azalea-client/src/plugins/packet/mod.rs index d7b0d9df..546405e0 100644 --- a/azalea-client/src/plugins/packet/mod.rs +++ b/azalea-client/src/plugins/packet/mod.rs @@ -6,7 +6,7 @@ use bevy_ecs::{ }; use self::game::DeathEvent; -use crate::chat::ChatReceivedEvent; +use crate::client_chat::ChatReceivedEvent; pub mod config; pub mod game; diff --git a/azalea/examples/testbot/commands.rs b/azalea/examples/testbot/commands.rs index 4c0e7235..e8a9855f 100644 --- a/azalea/examples/testbot/commands.rs +++ b/azalea/examples/testbot/commands.rs @@ -3,7 +3,7 @@ pub mod debug; pub mod movement; use azalea::{ - Client, brigadier::prelude::*, chat::ChatPacket, entity::metadata::Player, + Client, brigadier::prelude::*, client_chat::ChatPacket, entity::metadata::Player, player::GameProfileComponent, }; use bevy_ecs::query::With; diff --git a/azalea/src/client_impl/chat.rs b/azalea/src/client_impl/chat.rs index 2490e08c..f023fbc1 100644 --- a/azalea/src/client_impl/chat.rs +++ b/azalea/src/client_impl/chat.rs @@ -1,4 +1,4 @@ -use azalea_client::chat::{ChatKind, SendChatEvent, handler::SendChatKindEvent}; +use azalea_client::client_chat::{ChatKind, SendChatEvent, handler::SendChatKindEvent}; use crate::Client; diff --git a/azalea/src/events.rs b/azalea/src/events.rs index 4bef3165..0af11c6d 100644 --- a/azalea/src/events.rs +++ b/azalea/src/events.rs @@ -17,8 +17,8 @@ use derive_more::{Deref, DerefMut}; use tokio::sync::mpsc; use crate::{ - chat::{ChatPacket, ChatReceivedEvent}, chunks::ReceiveChunkEvent, + client_chat::{ChatPacket, ChatReceivedEvent}, disconnect::DisconnectEvent, packet::game::{ AddPlayerEvent, DeathEvent, KeepAliveEvent, RemovePlayerEvent, UpdatePlayerEvent, diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index 3be74b9e..f70a77fa 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -47,6 +47,7 @@ pub use azalea_registry as registry; #[doc(hidden)] #[deprecated(note = "renamed to `Identifier`.")] pub type ResourceLocation = azalea_registry::identifier::Identifier; +pub use azalea_chat as chat; pub use azalea_registry::identifier::Identifier; pub use azalea_world as world; pub use bevy_app as app; diff --git a/azalea/src/pathfinder/debug.rs b/azalea/src/pathfinder/debug.rs index 0117479c..ea34a43c 100644 --- a/azalea/src/pathfinder/debug.rs +++ b/azalea/src/pathfinder/debug.rs @@ -1,4 +1,4 @@ -use azalea_client::{chat::SendChatEvent, local_player::WorldHolder}; +use azalea_client::{client_chat::SendChatEvent, local_player::WorldHolder}; use azalea_core::position::Vec3; use bevy_ecs::prelude::*; diff --git a/azalea/src/swarm/chat.rs b/azalea/src/swarm/chat.rs index c5e3eba3..ed19f0f5 100644 --- a/azalea/src/swarm/chat.rs +++ b/azalea/src/swarm/chat.rs @@ -15,7 +15,7 @@ use std::collections::VecDeque; -use azalea_client::chat::{ChatPacket, ChatReceivedEvent}; +use azalea_client::client_chat::{ChatPacket, ChatReceivedEvent}; use bevy_app::{App, Plugin, Update}; use super::{Swarm, SwarmEvent}; diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 616733f8..69f2b3e5 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -12,7 +12,7 @@ use std::sync::{ atomic::{self, AtomicBool}, }; -use azalea_client::{account::Account, chat::ChatPacket, join::ConnectOpts}; +use azalea_client::{account::Account, client_chat::ChatPacket, join::ConnectOpts}; use azalea_entity::LocalEntity; use azalea_protocol::address::ResolvedAddr; use azalea_world::Worlds; |
