aboutsummaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-05-23 03:24:12 +0000
committermat <git@matdoes.dev>2024-05-23 03:24:12 +0000
commit22baedb24b0d6b2b9148b3e0050d9bb36a4a54ab (patch)
treefad884a15852a4eb5845af174a428a66a421f418 /codegen
parent4f6f104ddbf6895c78c3eaf3a33a51ceceac6ce4 (diff)
downloadazalea-drasl-22baedb24b0d6b2b9148b3e0050d9bb36a4a54ab.tar.xz
change property names to be unique and to match the minecraft ids
Diffstat (limited to 'codegen')
-rwxr-xr-xcodegen/lib/code/blocks.py3
-rwxr-xr-xcodegen/lib/code/utils.py10
2 files changed, 6 insertions, 7 deletions
diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py
index 64347849..05788731 100755
--- a/codegen/lib/code/blocks.py
+++ b/codegen/lib/code/blocks.py
@@ -125,8 +125,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, pixlyzer_block_dat
assert property_default is not None
- property_name = clean_property_name(property_name)
- this_property_code = f'{property_name}: {property_default_type}'
+ this_property_code = f'"{property_name}": {property_default_type}'
properties_code += f'\n {this_property_code},'
# if there's nothing inside the properties, keep it in one line
diff --git a/codegen/lib/code/utils.py b/codegen/lib/code/utils.py
index f4f9ca82..71b7d7d8 100755
--- a/codegen/lib/code/utils.py
+++ b/codegen/lib/code/utils.py
@@ -177,12 +177,12 @@ def fmt():
def clean_property_name(property_name):
# if the name ends with _<number>, remove that part
- ending = property_name.split('_')[-1]
- if ending.isdigit():
- property_name = property_name[:-(len(ending) + 1)]
+ # ending = property_name.split('_')[-1]
+ # if ending.isdigit():
+ # property_name = property_name[:-(len(ending) + 1)]
# `type` is a reserved keyword, so we use kind instead ¯\_(ツ)_/¯
- if property_name == 'type':
- property_name = 'kind'
+ # if property_name == 'type':
+ # property_name = 'kind'
return property_name