Skip to main content

azalea_chat/component/
selector.rs

1use azalea_codec::Codec;
2
3use crate::{
4    FormattedText,
5    component::{base::BaseComponent, common::EntitySelector, text::TextComponent},
6};
7
8#[derive(Clone, Debug, Default, PartialEq, Codec)]
9pub struct SelectorComponent {
10    pub selector: EntitySelector,
11    pub separator: Option<Box<FormattedText>>,
12    #[codec(flatten)]
13    pub base: BaseComponent,
14}
15
16impl SelectorComponent {
17    pub fn into_text_component(self) -> TextComponent {
18        TextComponent::default().with_base(self.base)
19    }
20}