aboutsummaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-25 20:24:41 -0500
committermat <github@matdoes.dev>2022-05-25 20:24:41 -0500
commit054c6e678bc015f674c2d15cb6432a46d81d5934 (patch)
tree5d5683aac918d55b194711227228fe904bd16ba4 /codegen
parent9d0de818f8306a401efcd9244c6e06aa5e8189db (diff)
downloadazalea-drasl-054c6e678bc015f674c2d15cb6432a46d81d5934.tar.xz
fix set_packets maybe
Diffstat (limited to 'codegen')
-rw-r--r--codegen/lib/code/packet.py6
-rw-r--r--codegen/migrate.py1
2 files changed, 3 insertions, 4 deletions
diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py
index af41a390..8563e5b9 100644
--- a/codegen/lib/code/packet.py
+++ b/codegen/lib/code/packet.py
@@ -117,7 +117,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction:
assert len(packet_ids) == len(packet_class_names)
# sort the packets by id
- zipped_packets: list[tuple[int, str]] = [list(x) for x in zip(
+ packet_ids, packet_class_names = [list(x) for x in zip(
*sorted(zip(packet_ids, packet_class_names), key=lambda pair: pair[0]))] # type: ignore
mod_rs_dir = f'../azalea-protocol/src/packets/{state}/mod.rs'
@@ -132,7 +132,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction:
new_mod_rs.append(line)
if direction == 'serverbound':
ignore_lines = True
- for packet_id, packet_class_name in zipped_packets:
+ for packet_id, packet_class_name in zip(packet_ids, packet_class_names):
new_mod_rs.append(
make_packet_mod_rs_line(packet_id, packet_class_name)
)
@@ -143,7 +143,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction:
new_mod_rs.append(line)
if direction == 'serverbound':
ignore_lines = True
- for packet_id, packet_class_name in zipped_packets:
+ for packet_id, packet_class_name in zip(packet_ids, packet_class_names):
new_mod_rs.append(
make_packet_mod_rs_line(packet_id, packet_class_name)
)
diff --git a/codegen/migrate.py b/codegen/migrate.py
index 890186b8..392af9fe 100644
--- a/codegen/migrate.py
+++ b/codegen/migrate.py
@@ -58,7 +58,6 @@ for (direction, state), packets in group_packets(list(changed_packets.keys())).i
new_packet_id = changed_packets[PacketIdentifier(
old_packet_id, direction, state)]
id_map[old_packet_id] = new_packet_id
-
lib.code.packet.change_packet_ids(id_map, direction, state)