diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-08-10 18:55:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-10 18:55:23 -0500 |
| commit | 7120842f9d2c659a2f12d8922299c2a761bc5582 (patch) | |
| tree | 0d7976ceec82d914e4c75f23adcdd5839f9960a4 /azalea-chat/src/base_component.rs | |
| parent | 3b659833c1ad4cca89b4cd553193edcb6d223163 (diff) | |
| download | azalea-drasl-7120842f9d2c659a2f12d8922299c2a761bc5582.tar.xz | |
Send correct data component checksums (#234)
* start implementing data component crc32 hashes
* start doing serde impls for checksums
* make more components hashable
* make all data components serializable
* support recursive components
* fix simdnbt dep
* update changelog
* clippy
Diffstat (limited to 'azalea-chat/src/base_component.rs')
| -rw-r--r-- | azalea-chat/src/base_component.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/azalea-chat/src/base_component.rs b/azalea-chat/src/base_component.rs index cbc5ae8b..366904c7 100644 --- a/azalea-chat/src/base_component.rs +++ b/azalea-chat/src/base_component.rs @@ -2,20 +2,26 @@ use serde::Serialize; use crate::{FormattedText, style::Style}; -#[derive(Clone, Debug, PartialEq, Serialize, Eq, Hash)] +#[derive(Clone, Debug, PartialEq, Serialize)] pub struct BaseComponent { // implements mutablecomponent #[serde(skip_serializing_if = "Vec::is_empty")] pub siblings: Vec<FormattedText>, #[serde(flatten)] - pub style: Style, + pub style: Box<Style>, } impl BaseComponent { pub fn new() -> Self { Self { siblings: Vec::new(), - style: Style::default(), + style: Default::default(), + } + } + pub fn with_style(self, style: Style) -> Self { + Self { + style: Box::new(style), + ..self } } } |
