diff options
| author | mat <git@matdoes.dev> | 2024-12-19 02:31:08 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-12-19 02:52:41 +0000 |
| commit | e268c4929177e540baa9d2bb29bc171f49cc7a25 (patch) | |
| tree | 10146e529088ab823452a5971c0a37a8886b2a68 /codegen/lib/code/packet.py | |
| parent | 1f06a1540f46d8087907566d7c6c1ab397c517ec (diff) | |
| download | azalea-drasl-e268c4929177e540baa9d2bb29bc171f49cc7a25.tar.xz | |
fix incorrect packets
Diffstat (limited to 'codegen/lib/code/packet.py')
| -rwxr-xr-x | codegen/lib/code/packet.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index 71bc3a70..1d60378a 100755 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -6,9 +6,6 @@ import os import re -def make_packet_mod_rs_line(packet_id: int, packet_class_name: str): - return f' {padded_hex(packet_id)}: {to_snake_case(packet_class_name)}::{to_camel_case(packet_class_name)},' - MOJMAP_TO_AZALEA_STATE_NAME_MAPPING = { # shorter name, i like it more 'configuration': 'config', @@ -62,12 +59,12 @@ def set_packets(packets_report): code.append('') code.append(f'declare_state_packets!({to_camel_case(state)}Packet,') code.append(' Clientbound => [') - for packet_name in clientbound_packets: - code.append(f' {packet_name},') + for packet_id, packet_name in enumerate(clientbound_packets): + code.append(f' {packet_name}, // {padded_hex(packet_id)}') code.append(' ],') code.append(' Serverbound => [') - for packet_name in serverbound_packets: - code.append(f' {packet_name},') + for packet_id, packet_name in enumerate(serverbound_packets): + code.append(f' {packet_name}, // {padded_hex(packet_id)}') code.append(' ]') code.append(');') code.append('') |
