From e268c4929177e540baa9d2bb29bc171f49cc7a25 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 19 Dec 2024 02:31:08 +0000 Subject: fix incorrect packets --- codegen/lib/code/packet.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'codegen/lib/code/packet.py') 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('') -- cgit v1.2.3