diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-09-30 10:56:34 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-30 10:56:34 -0500 |
| commit | 643fcb98c0e6cdc63218dd39960d9053b209d9a6 (patch) | |
| tree | 6bddb7fe39b8fcc3ab3fb2665574533bb227898a /azalea-entity/src/data.rs | |
| parent | a80d8d1b242430c4a251876fa67bfd26af7a0de9 (diff) | |
| download | azalea-drasl-643fcb98c0e6cdc63218dd39960d9053b209d9a6.tar.xz | |
1.21.9 (#235)
* start updating to 25w33a
* 1.21.9-pre2
* clippy
* cleanup, and fix c_explode and c_player_rotation
* mc update should be in Changed section in the changelog
* 1.21.9
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, +} |
