diff options
| author | mat <github@matdoes.dev> | 2023-05-04 20:38:10 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2023-05-04 20:38:10 +0000 |
| commit | c7a923ccc8ae825deca62ac2cc8c80c01484d5b6 (patch) | |
| tree | 787c6eb579d0b126f0e9dfa161bdea758fe9aa0a /codegen/lib/code/entity.py | |
| parent | ff6d43458cef8ac6a23e6e8accd4b71c2a04aef6 (diff) | |
| parent | 634cb8d72c6608512aedba19e5cd669104bc35ea (diff) | |
| download | azalea-drasl-c7a923ccc8ae825deca62ac2cc8c80c01484d5b6.tar.xz | |
merge main
Diffstat (limited to 'codegen/lib/code/entity.py')
| -rw-r--r-- | codegen/lib/code/entity.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/codegen/lib/code/entity.py b/codegen/lib/code/entity.py index c787ffd4..67e818b7 100644 --- a/codegen/lib/code/entity.py +++ b/codegen/lib/code/entity.py @@ -12,7 +12,7 @@ DATA_RS_DIR = get_dir_location( '../azalea-world/src/entity/data.rs') def generate_metadata_names(burger_dataserializers: dict, mappings: Mappings): - serializer_names = [None] * len(burger_dataserializers) + serializer_names: list[Optional[str]] = [None] * len(burger_dataserializers) for burger_serializer in burger_dataserializers.values(): print(burger_serializer) @@ -105,7 +105,8 @@ use super::{ SnifferState, VillagerData }; use azalea_chat::FormattedText; -use azalea_core::{BlockPos, Direction, Particle, Slot, Vec3}; +use azalea_core::{BlockPos, Direction, Particle, Vec3}; +use azalea_inventory::ItemSlot; use bevy_ecs::{bundle::Bundle, component::Component}; use derive_more::{Deref, DerefMut}; use thiserror::Error; @@ -425,7 +426,7 @@ impl From<EntityDataValue> for UpdateMetadataError { elif type_name == 'OptionalUnsignedInt': default = f'OptionalUnsignedInt(Some({default}))' if default != 'Empty' else 'OptionalUnsignedInt(None)' elif type_name == 'ItemStack': - default = f'Slot::Present({default})' if default != 'Empty' else 'Slot::Empty' + default = f'ItemSlot::Present({default})' if default != 'Empty' else 'ItemSlot::Empty' elif type_name == 'BlockState': default = f'{default}' if default != 'Empty' else 'azalea_block::BlockState::AIR' elif type_name == 'OptionalBlockState': |
