From 23b7f20a0d88b54d430820baeb4a6da0316a009a Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:43:10 -0500 Subject: Default components (#232) * add default components * remove debug prints * clippy * use default components * fix tests --- azalea-chat/src/component.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'azalea-chat/src/component.rs') diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 1cb2bf30..2a7e588e 100644 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -587,6 +587,16 @@ impl From<&str> for FormattedText { Self::from(s.to_string()) } } +impl From for FormattedText { + fn from(c: TranslatableComponent) -> Self { + FormattedText::Translatable(c) + } +} +impl From for FormattedText { + fn from(c: TextComponent) -> Self { + FormattedText::Text(c) + } +} impl Display for FormattedText { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { -- cgit v1.2.3