diff options
Diffstat (limited to 'azalea-world/src/entity/data.rs')
| -rwxr-xr-x | azalea-world/src/entity/data.rs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/azalea-world/src/entity/data.rs b/azalea-world/src/entity/data.rs index baebd210..14d257e3 100755 --- a/azalea-world/src/entity/data.rs +++ b/azalea-world/src/entity/data.rs @@ -1,15 +1,20 @@ +//! Define some types needed for entity metadata. + use azalea_block::BlockState; -use azalea_buf::{BufReadError, McBufVarReadable, McBufVarWritable}; -use azalea_buf::{McBuf, McBufReadable, McBufWritable}; -use azalea_chat::Component; +use azalea_buf::{ + BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, +}; +use azalea_chat::FormattedText; use azalea_core::{BlockPos, Direction, GlobalPos, Particle, Slot}; +use azalea_ecs::component::Component; +use derive_more::Deref; use enum_as_inner::EnumAsInner; use nohash_hasher::IntSet; use std::io::{Cursor, Write}; use uuid::Uuid; -#[derive(Clone, Debug)] -pub struct EntityMetadataItems(pub Vec<EntityDataItem>); +#[derive(Clone, Debug, Deref)] +pub struct EntityMetadataItems(Vec<EntityDataItem>); #[derive(Clone, Debug)] pub struct EntityDataItem { @@ -52,8 +57,8 @@ pub enum EntityDataValue { Long(i64), Float(f32), String(String), - Component(Component), - OptionalComponent(Option<Component>), + FormattedText(FormattedText), + OptionalFormattedText(Option<FormattedText>), ItemStack(Slot), Boolean(bool), Rotations(Rotations), @@ -105,7 +110,7 @@ pub struct Rotations { pub z: f32, } -#[derive(Clone, Debug, Copy, McBuf, Default)] +#[derive(Clone, Debug, Copy, McBuf, Default, Component)] pub enum Pose { #[default] Standing = 0, @@ -120,7 +125,7 @@ pub enum Pose { #[derive(Debug, Clone, McBuf)] pub struct VillagerData { - pub kind: azalea_registry::VillagerType, + pub kind: azalea_registry::VillagerKind, pub profession: azalea_registry::VillagerProfession, #[var] pub level: u32, |
