aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-10-07 06:01:19 +0400
committermat <git@matdoes.dev>2025-10-07 06:01:19 +0400
commit1cf6d92f1a8be954f6885704c31f317b99b05972 (patch)
treeab241a7b6fda815e777b914a8a9a153d23e81f06 /azalea-entity/src
parent06807ec3ea7df6e83eed51b38f9d5e3bea9e7045 (diff)
downloadazalea-drasl-1cf6d92f1a8be954f6885704c31f317b99b05972.tar.xz
update ResolvableProfile data component to 1.21.9
Diffstat (limited to 'azalea-entity/src')
-rw-r--r--azalea-entity/src/data.rs51
-rw-r--r--azalea-entity/src/metadata.rs7
2 files changed, 5 insertions, 53 deletions
diff --git a/azalea-entity/src/data.rs b/azalea-entity/src/data.rs
index 84a5b153..65267c4a 100644
--- a/azalea-entity/src/data.rs
+++ b/azalea-entity/src/data.rs
@@ -2,15 +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 azalea_inventory::{ItemStack, components};
use bevy_ecs::component::Component;
use derive_more::Deref;
use enum_as_inner::EnumAsInner;
@@ -97,7 +95,7 @@ pub enum EntityDataValue {
WeatheringCopperState(WeatheringCopperStateKind),
Vector3(Vec3f32),
Quaternion(Quaternion),
- ResolvableProfile(ResolvableProfile),
+ ResolvableProfile(components::Profile),
}
#[derive(Clone, Debug, PartialEq)]
@@ -111,51 +109,6 @@ 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)]
diff --git a/azalea-entity/src/metadata.rs b/azalea-entity/src/metadata.rs
index 56455bb7..68b8b78c 100644
--- a/azalea-entity/src/metadata.rs
+++ b/azalea-entity/src/metadata.rs
@@ -8,7 +8,7 @@ use azalea_core::{
direction::Direction,
position::{BlockPos, Vec3f32},
};
-use azalea_inventory::ItemStack;
+use azalea_inventory::{ItemStack, components};
use azalea_registry::DataRegistry;
use bevy_ecs::{bundle::Bundle, component::Component};
use derive_more::{Deref, DerefMut};
@@ -17,8 +17,7 @@ use uuid::Uuid;
use super::{
ArmadilloStateKind, CopperGolemStateKind, EntityDataItem, EntityDataValue, OptionalUnsignedInt,
- Pose, Quaternion, ResolvableProfile, Rotations, SnifferStateKind, VillagerData,
- WeatheringCopperStateKind,
+ Pose, Quaternion, Rotations, SnifferStateKind, VillagerData, WeatheringCopperStateKind,
};
use crate::particle::Particle;
@@ -6054,7 +6053,7 @@ pub struct MannequinPlayerMainHand(pub u8);
#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct MannequinPlayerModeCustomisation(pub u8);
#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
-pub struct Profile(pub ResolvableProfile);
+pub struct Profile(pub components::Profile);
#[derive(Component, Deref, DerefMut, Clone, PartialEq)]
pub struct Immovable(pub bool);
#[derive(Component, Deref, DerefMut, Clone, PartialEq)]