#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] use std::io::{self, Cursor, Write}; use std::{ fmt::{self, Display}, sync::LazyLock, }; #[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] use azalea_buf::{AzBuf, BufReadError}; use serde::{Deserialize, Deserializer, Serialize, de}; use crate::{ base_component::BaseComponent, style::{ChatFormatting, Style}, text_component::TextComponent, translatable_component::{PrimitiveOrComponent, 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