aboutsummaryrefslogtreecommitdiff
path: root/azalea-chat/src
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-11-06 14:05:01 -0600
committerGitHub <noreply@github.com>2022-11-06 14:05:01 -0600
commitd112856ff6353592a50658b0ddd316f54dd97b87 (patch)
tree6c408ecab96012e3bffaf15843fad5b9b6817796 /azalea-chat/src
parent9bc517511663193f3166320db4cb5ca02701b039 (diff)
downloadazalea-drasl-d112856ff6353592a50658b0ddd316f54dd97b87.tar.xz
Entity metadata (#37)
* add example generated metadata.rs * metadata.rs codegen * add the files * add comment to top of metadata.rs * avoid clone * metadata * defaults * defaults * fix metadata readers and writers * fix bad bitmasks and ignore some clippy warnings in generated code * add set_index function to entity metadatas * applying metadata
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,