aboutsummaryrefslogtreecommitdiff
path: root/codegen/genblocks.py
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-06-17 23:10:54 +0000
committerGitHub <noreply@github.com>2022-06-17 23:10:54 +0000
commitf414aa4d37e0c6a7adf55b772fa93714be6e9c9c (patch)
tree8cfb7d33114b9537b50477d5d6980995eec6cc5c /codegen/genblocks.py
parent56f98c1b243d1ba8906ac73a2f2d8eec5646183e (diff)
parent0a945e73ec43b3b0389e004e138c83f41cddc532 (diff)
downloadazalea-drasl-f414aa4d37e0c6a7adf55b772fa93714be6e9c9c.tar.xz
Merge pull request #9 from mat-1/azalea-block
azalea-block
Diffstat (limited to 'codegen/genblocks.py')
-rw-r--r--codegen/genblocks.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/codegen/genblocks.py b/codegen/genblocks.py
new file mode 100644
index 00000000..9e35f7f3
--- /dev/null
+++ b/codegen/genblocks.py
@@ -0,0 +1,28 @@
+import lib.code.version
+import lib.code.packet
+import lib.code.blocks
+import lib.code.utils
+import lib.download
+import lib.extract
+import lib.utils
+import sys
+import os
+
+version_id = lib.code.version.get_version_id()
+
+lib.download.get_burger()
+lib.download.get_client_jar(version_id)
+
+print('Generating data with burger')
+os.system(
+ f'cd {lib.utils.get_dir_location("downloads/Burger")} && python munch.py ../client-{version_id}.jar --output ../burger-{version_id}.json --toppings blockstates'
+)
+print('Ok')
+
+mappings = lib.download.get_mappings_for_version(version_id)
+block_states_burger = lib.extract.get_block_states_burger(version_id)
+ordered_blocks = lib.extract.get_ordered_blocks_burger(version_id)
+block_states_report = lib.extract.get_block_states_report(version_id)
+
+lib.code.blocks.generate_blocks(
+ block_states_burger, block_states_report, ordered_blocks, mappings)