diff options
Diffstat (limited to 'azalea-entity/src/data.rs')
| -rw-r--r-- | azalea-entity/src/data.rs | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/azalea-entity/src/data.rs b/azalea-entity/src/data.rs index d9d2a985..84a5b153 100644 --- a/azalea-entity/src/data.rs +++ b/azalea-entity/src/data.rs @@ -2,11 +2,13 @@ use std::io::{self, Cursor, Write}; +use azalea_auth::game_profile::{GameProfile, GameProfileProperties}; use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_chat::FormattedText; use azalea_core::{ direction::Direction, position::{BlockPos, GlobalPos, Vec3f32}, + resource_location::ResourceLocation, }; use azalea_inventory::ItemStack; use bevy_ecs::component::Component; @@ -74,7 +76,6 @@ pub enum EntityDataValue { BlockState(azalea_block::BlockState), /// If this is air, that means it's absent, OptionalBlockState(azalea_block::BlockState), - CompoundTag(simdnbt::owned::NbtCompound), Particle(Particle), Particles(Vec<Particle>), VillagerData(VillagerData), @@ -92,8 +93,11 @@ pub enum EntityDataValue { PaintingVariant(azalea_registry::PaintingVariant), SnifferState(SnifferStateKind), ArmadilloState(ArmadilloStateKind), + CopperGolemState(CopperGolemStateKind), + WeatheringCopperState(WeatheringCopperStateKind), Vector3(Vec3f32), Quaternion(Quaternion), + ResolvableProfile(ResolvableProfile), } #[derive(Clone, Debug, PartialEq)] @@ -107,6 +111,51 @@ pub struct Quaternion { pub w: f32, } +#[derive(Clone, Debug, AzBuf, Default, PartialEq)] +pub struct ResolvableProfile { + pub unpack: Box<PartialOrFullProfile>, + pub skin_patch: Box<PlayerSkinPatch>, +} + +#[derive(Clone, Debug, AzBuf, PartialEq)] +pub enum PartialOrFullProfile { + Partial(PartialProfile), + Full(GameProfile), +} +impl Default for PartialOrFullProfile { + fn default() -> Self { + Self::Partial(PartialProfile::default()) + } +} + +#[derive(Clone, Debug, AzBuf, Default, PartialEq)] +pub struct PartialProfile { + #[limit(16)] + pub name: Option<String>, + pub id: Option<Uuid>, + pub properties: GameProfileProperties, +} + +#[derive(Clone, Debug, AzBuf, Default, PartialEq)] +pub struct PlayerSkinPatch { + pub body: Option<ResourceTexture>, + pub cape: Option<ResourceTexture>, + pub elytra: Option<ResourceTexture>, + pub model: Option<PlayerModelType>, +} + +#[derive(Clone, Debug, Copy, AzBuf, Default, PartialEq)] +pub enum PlayerModelType { + #[default] + Wide, + Slim, +} + +#[derive(Clone, Debug, AzBuf, PartialEq)] +pub struct ResourceTexture { + pub id: ResourceLocation, +} + // mojang just calls this ArmadilloState but i added "Kind" since otherwise it // collides with a name in metadata.rs #[derive(Clone, Debug, Copy, Default, AzBuf, PartialEq)] @@ -186,3 +235,21 @@ pub enum SnifferStateKind { Digging, Rising, } + +#[derive(Debug, Copy, Clone, AzBuf, Default, PartialEq)] +pub enum CopperGolemStateKind { + #[default] + Idle, + GettingItem, + GettingNoItem, + DroppingItem, + DroppingNoItem, +} +#[derive(Debug, Copy, Clone, AzBuf, Default, PartialEq)] +pub enum WeatheringCopperStateKind { + #[default] + Unaffected, + Exposed, + Weathered, + Oxidized, +} |
