diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-11-19 22:07:38 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-19 22:07:38 -0600 |
| commit | 2c610826fc9f8e16897f52313faa8e0602d1dc3d (patch) | |
| tree | 5aad79ecab3b68511a10ebd7eba07af0bd8a5905 /codegen | |
| parent | 84e036ce3752ecf57904b0f5aff1f33d43e95a32 (diff) | |
| download | azalea-drasl-2c610826fc9f8e16897f52313faa8e0602d1dc3d.tar.xz | |
Replace azalea-nbt with simdnbt (#111)
* delete azalea-nbt and replace with simdnbt
* use simdnbt from crates.io
* remove serde dependency on azalea-registry
Diffstat (limited to 'codegen')
| -rw-r--r-- | codegen/lib/code/entity.py | 4 | ||||
| -rwxr-xr-x | codegen/lib/code/utils.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/codegen/lib/code/entity.py b/codegen/lib/code/entity.py index 7be6b01d..8fa11430 100644 --- a/codegen/lib/code/entity.py +++ b/codegen/lib/code/entity.py @@ -400,7 +400,7 @@ impl From<EntityDataValue> for UpdateMetadataError { if default is None: # some types don't have Default implemented if type_name == 'CompoundTag': - default = 'azalea_nbt::Nbt::Compound(Default::default())' + default = 'simdnbt::owned::NbtCompound::default()' elif type_name == 'CatVariant': default = 'azalea_registry::CatVariant::Tabby' elif type_name == 'PaintingVariant': @@ -434,7 +434,7 @@ impl From<EntityDataValue> for UpdateMetadataError { elif type_name == 'OptionalFormattedText': default = f'Some({default})' if default != 'Empty' else 'None' elif type_name == 'CompoundTag': - default = f'azalea_nbt::Nbt::Compound({default})' if default != 'Empty' else 'azalea_nbt::Nbt::Compound(Default::default())' + default = f'simdnbt::owned::NbtCompound({default})' if default != 'Empty' else 'simdnbt::owned::NbtCompound::default()' elif type_name == 'Quaternion': default = f'Quaternion {{ x: {float(default["x"])}, y: {float(default["y"])}, z: {float(default["z"])}, w: {float(default["w"])} }}' elif type_name == 'Vector3': diff --git a/codegen/lib/code/utils.py b/codegen/lib/code/utils.py index 0050ce7b..cb835ecb 100755 --- a/codegen/lib/code/utils.py +++ b/codegen/lib/code/utils.py @@ -56,7 +56,7 @@ def burger_type_to_rust_type(burger_type, field_name: Optional[str] = None, inst field_type_rs = 'BlockPos' uses.add('azalea_core::position::BlockPos') elif burger_type == 'nbtcompound': - field_type_rs = 'azalea_nbt::Nbt' + field_type_rs = 'simdnbt::owned::NbtCompound' elif burger_type == 'itemstack': field_type_rs = 'Slot' uses.add('azalea_core::slot::Slot') |
