aboutsummaryrefslogtreecommitdiff
path: root/codegen
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 /codegen
parent06807ec3ea7df6e83eed51b38f9d5e3bea9e7045 (diff)
downloadazalea-drasl-1cf6d92f1a8be954f6885704c31f317b99b05972.tar.xz
update ResolvableProfile data component to 1.21.9
Diffstat (limited to 'codegen')
-rw-r--r--codegen/lib/code/data_components.py8
-rw-r--r--codegen/lib/code/entity.py5
2 files changed, 6 insertions, 7 deletions
diff --git a/codegen/lib/code/data_components.py b/codegen/lib/code/data_components.py
index b1444860..89796a91 100644
--- a/codegen/lib/code/data_components.py
+++ b/codegen/lib/code/data_components.py
@@ -4,7 +4,7 @@ import lib.extract
import lib.utils
-DATA_COMPONENTS_DIR = "azalea-inventory/src/components.rs"
+DATA_COMPONENTS_DIR = "azalea-inventory/src/components/mod.rs"
DEFAULT_DATA_COMPONENTS_DIR = "azalea-inventory/src/default_components/generated.rs"
@@ -322,7 +322,7 @@ use crate::{
entity_id = python_value["id"]
elif isinstance(python_value, str):
entity_id = python_value
-
+
if entity_id and entity_id.startswith("minecraft:"):
entity_name = entity_id[10:] # Remove "minecraft:" prefix
entity_name_camel = lib.utils.to_camel_case(entity_name)
@@ -512,7 +512,7 @@ use crate::{
# Special handling for EntityData to use EntityData structure
# Keep rust_value as "value" so it gets processed correctly
field_type = "EntityKind"
-
+
def transform_value_fn(rust_value: str):
return f"{component_struct_name} {{ kind: {rust_value}, data: NbtCompound::new() }}"
@@ -623,7 +623,7 @@ use crate::{
def get_enum_and_struct_fields():
"""
Returns a map like map like `{ "MaxStackSize": { "count": i32 }, "Rarity": [ "common", ... ], ... }`
- with an entry for each struct in components.rs.
+ with an entry for each struct in components/mod.rs.
"""
with open(DATA_COMPONENTS_DIR, "r") as f:
diff --git a/codegen/lib/code/entity.py b/codegen/lib/code/entity.py
index 1c2a0d48..18a7a04b 100644
--- a/codegen/lib/code/entity.py
+++ b/codegen/lib/code/entity.py
@@ -113,7 +113,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};
@@ -122,8 +122,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;