diff options
| author | mat <github@matdoes.dev> | 2022-05-07 18:30:44 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-05-07 18:30:44 -0500 |
| commit | 2ddbc5cfc00897ed644f29456a52c4f07f94844f (patch) | |
| tree | eb0316b2a88fca19fc85e21653ab0dcdbda2beeb /data-code-generator/packetcodegen.py | |
| parent | c10b732510868819a652b76e31278906914d699d (diff) | |
| download | azalea-drasl-2ddbc5cfc00897ed644f29456a52c4f07f94844f.tar.xz | |
improve usage
Diffstat (limited to 'data-code-generator/packetcodegen.py')
| -rw-r--r-- | data-code-generator/packetcodegen.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/data-code-generator/packetcodegen.py b/data-code-generator/packetcodegen.py index 12855d08..59a48535 100644 --- a/data-code-generator/packetcodegen.py +++ b/data-code-generator/packetcodegen.py @@ -70,16 +70,15 @@ def write_packet_file(state, packet_name_snake_case, code): f.write(code) -def generate(burger_packets, mappings: Mappings, packet_ids): +def generate(burger_packets, mappings: Mappings, target_packet_id, target_packet_direction, target_packet_state): for packet in burger_packets.values(): - if packet['id'] not in packet_ids: + if packet['id'] != target_packet_id: continue direction = packet['direction'].lower() # serverbound or clientbound state = {'PLAY': 'game'}.get(packet['state'], packet['state'].lower()) - # TODO: have something better to control this - if state != 'game' or direction != 'clientbound': + if state != target_packet_state or direction != target_packet_direction: continue generated_packet_code = [] |
