aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/code/blocks.py
blob: fd268b9814de0f9464e761cf1a00af4d81a17527 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from lib.utils import get_dir_location


BLOCKS_RS_DIR = get_dir_location('../azalea-block/src/blocks.rs')


def generate_blocks(blocks: dict):
    with open(BLOCKS_RS_DIR, 'r') as f:
        existing_code = f.read().splitlines()

    new_make_block_states_macro_code = []
    new_make_block_states_macro_code.append('make_block_states! {')

    properties = {}
    for block_name, block_data in blocks.items():
        block_properties = block_data['properties']

        properties.update(block_properties)

    print(properties)