use std::{fmt::Display, sync::LazyLock}; #[cfg(feature = "azalea-buf")] use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; use serde::{de, Deserialize, Deserializer, Serialize}; #[cfg(feature = "simdnbt")] use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _}; 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, Eq, Serialize, Hash)] #[serde(untagged)] pub enum FormattedText { Text(TextComponent), Translatable(TranslatableComponent), } pub static DEFAULT_STYLE: LazyLock