aboutsummaryrefslogtreecommitdiff
path: root/azalea-chat/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-chat/src')
-rwxr-xr-xazalea-chat/src/component.rs6
-rw-r--r--azalea-chat/src/text_component.rs2
2 files changed, 7 insertions, 1 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs
index 4df3796f..e4c0ab72 100755
--- a/azalea-chat/src/component.rs
+++ b/azalea-chat/src/component.rs
@@ -289,3 +289,9 @@ impl Display for Component {
}
}
}
+
+impl Default for Component {
+ fn default() -> Self {
+ Component::Text(TextComponent::default())
+ }
+}
diff --git a/azalea-chat/src/text_component.rs b/azalea-chat/src/text_component.rs
index 46cb0951..eea66bb7 100644
--- a/azalea-chat/src/text_component.rs
+++ b/azalea-chat/src/text_component.rs
@@ -3,7 +3,7 @@ use std::fmt::Display;
use crate::{base_component::BaseComponent, style::ChatFormatting, Component};
/// A component that contains text that's the same in all locales.
-#[derive(Clone, Debug)]
+#[derive(Clone, Debug, Default)]
pub struct TextComponent {
pub base: BaseComponent,
pub text: String,