From 7c468692c7adf6c9a4796aa8010f20ced4618327 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 18 Dec 2025 20:47:37 -0400 Subject: smaller metadata.rs by avoiding duplication in default impls --- codegen/lib/code/blocks.py | 2 +- codegen/lib/code/entity.py | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'codegen/lib') diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py index 091faaea..e3becfe5 100644 --- a/codegen/lib/code/blocks.py +++ b/codegen/lib/code/blocks.py @@ -6,7 +6,7 @@ BLOCKS_RS_DIR = get_dir_location("../azalea-block/src/generated.rs") # - Property: A property of a block, like "direction" # - Variant: A potential state of a property, like "up" # - State: A possible state of a block, a combination of variants -# - BlockKind: Has properties and states. +# - Block: Has properties and states. def generate_blocks( diff --git a/codegen/lib/code/entity.py b/codegen/lib/code/entity.py index f6ca7c7b..75ca72e5 100644 --- a/codegen/lib/code/entity.py +++ b/codegen/lib/code/entity.py @@ -4,9 +4,7 @@ from typing import Optional import re METADATA_RS_DIR = get_dir_location("../azalea-entity/src/metadata.rs") - DATA_RS_DIR = get_dir_location("../azalea-entity/src/data.rs") - DIMENSIONS_RS_DIR = get_dir_location("../azalea-entity/src/dimensions.rs") @@ -513,13 +511,7 @@ impl From for UpdateMetadataError { this_entity_parent_ids[1] if len(this_entity_parent_ids) > 1 else None ) if this_entity_parent_id: - bundle_struct_name = ( - upper_first_letter(to_camel_case(this_entity_parent_id.lstrip("~"))) - + "MetadataBundle" - ) - code.append(f" parent: {bundle_struct_name} {{") - generate_fields(this_entity_parent_id) - code.append(" },") + code.append(" parent: Default::default(),") for index, name_or_bitfield in get_entity_metadata_names( this_entity_id, burger_entity_metadata, mappings -- cgit v1.2.3