aboutsummaryrefslogtreecommitdiff
path: root/codegen/newpacket.py
blob: b3a1c64ffdea484434d830b77f379ff6124758cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from lib import download, code  # type: ignore
import sys
import os

mappings = download.get_mappings_for_version('1.18.2')
burger_data = download.get_burger_data_for_version('1.18.2')

burger_packets_data = burger_data[0]['packets']['packet']
packet_id, direction, state = int(sys.argv[1]), sys.argv[2], sys.argv[3]
print(
    f'Generating code for packet id: {packet_id} with direction {direction} and state {state}')
code.packetcodegen.generate(burger_packets_data, mappings,
                            packet_id, direction, state)

code.fmt()

print('Done!')