mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 23:44:38 +00:00
make metadata components clonable
This commit is contained in:
parent
6942e3547b
commit
66094921c8
3 changed files with 273 additions and 273 deletions
File diff suppressed because it is too large
Load diff
|
@ -162,14 +162,14 @@ impl From<EntityDataValue> for UpdateMetadataError {
|
||||||
metadata_type_data = metadata_types[type_id]
|
metadata_type_data = metadata_types[type_id]
|
||||||
rust_type = metadata_type_data['type']
|
rust_type = metadata_type_data['type']
|
||||||
|
|
||||||
code.append(f'#[derive(Component, Deref, DerefMut)]')
|
code.append(f'#[derive(Component, Deref, DerefMut, Clone)]')
|
||||||
code.append(f'pub struct {struct_name}(pub {rust_type});')
|
code.append(f'pub struct {struct_name}(pub {rust_type});')
|
||||||
else:
|
else:
|
||||||
# if it's a bitfield just make a struct for each bit
|
# if it's a bitfield just make a struct for each bit
|
||||||
for mask, name in name_or_bitfield.items():
|
for mask, name in name_or_bitfield.items():
|
||||||
name = maybe_rename_field(name, index)
|
name = maybe_rename_field(name, index)
|
||||||
struct_name = upper_first_letter(to_camel_case(name))
|
struct_name = upper_first_letter(to_camel_case(name))
|
||||||
code.append(f'#[derive(Component, Deref, DerefMut)]')
|
code.append(f'#[derive(Component, Deref, DerefMut, Clone, Copy)]')
|
||||||
code.append(f'pub struct {struct_name}(pub bool);')
|
code.append(f'pub struct {struct_name}(pub bool);')
|
||||||
|
|
||||||
# add the entity struct and Bundle struct
|
# add the entity struct and Bundle struct
|
||||||
|
|
|
@ -54,7 +54,7 @@ def determine_python_command():
|
||||||
def try_python_command(version):
|
def try_python_command(version):
|
||||||
return os.system(f'{version} --version') == 0
|
return os.system(f'{version} --version') == 0
|
||||||
|
|
||||||
for version in ('python3.9', 'python3.8', 'python3', 'python'):
|
for version in (sys.executable, 'python3.9', 'python3.8', 'python3', 'python'):
|
||||||
if try_python_command(version):
|
if try_python_command(version):
|
||||||
python_command = version
|
python_command = version
|
||||||
return version
|
return version
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue