aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/code/blocks.py
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-21 18:33:17 -0500
committermat <github@matdoes.dev>2022-06-21 18:33:54 -0500
commit107f945a2383cb0f9ba8de458c7764e0afff026a (patch)
tree0d3489daf9993f6802011d07fe91a4869d9ffd60 /codegen/lib/code/blocks.py
parent405a00c0d1908a4b3fbd8e6684c77dfb178ac55d (diff)
downloadazalea-drasl-107f945a2383cb0f9ba8de458c7764e0afff026a.tar.xz
Add get_generator_mod_data
Uses u9g's mod: https://github.com/u9g/minecraft-data-generator-server
Diffstat (limited to 'codegen/lib/code/blocks.py')
-rw-r--r--codegen/lib/code/blocks.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py
index 4ab4917f..7dc85137 100644
--- a/codegen/lib/code/blocks.py
+++ b/codegen/lib/code/blocks.py
@@ -43,7 +43,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, ordered_blocks: li
if property is None:
return ''.join(map(to_camel_case, property_variants))
-
+
property_name = None
for class_name in [block_data_burger['class']] + block_data_burger['super']:
property_name = mappings.get_field(
@@ -103,7 +103,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, ordered_blocks: li
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'
@@ -180,6 +180,8 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, ordered_blocks: li
if in_macro:
continue
new_code.append(line)
+ # empty line at the end
+ new_code.append('')
with open(BLOCKS_RS_DIR, 'w') as f:
f.write('\n'.join(new_code))