#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] use std::io::{self, Cursor, Write}; use std::{ fmt::{self, Display}, sync::LazyLock, }; #[cfg(feature = "azalea-buf")] use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; use serde::{Deserialize, Deserializer, Serialize, de}; #[cfg(feature = "simdnbt")] use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _}; #[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] use tracing::{debug, trace, warn}; use crate::{ base_component::BaseComponent, style::{ChatFormatting, Style}, text_component::TextComponent, translatable_component::{StringOrComponent, TranslatableComponent}, }; /// A chat component, basically anything you can see in chat. #[derive(Clone, Debug, PartialEq, Serialize)] #[serde(untagged)] pub enum FormattedText { Text(TextComponent), Translatable(TranslatableComponent), } pub static DEFAULT_STYLE: LazyLock