From d112856ff6353592a50658b0ddd316f54dd97b87 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sun, 6 Nov 2022 14:05:01 -0600 Subject: 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 --- azalea-chat/src/component.rs | 6 ++++++ azalea-chat/src/text_component.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'azalea-chat/src') 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, -- cgit v1.2.3