aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/code/packet.py
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-06-17 23:10:54 +0000
committerGitHub <noreply@github.com>2022-06-17 23:10:54 +0000
commitf414aa4d37e0c6a7adf55b772fa93714be6e9c9c (patch)
tree8cfb7d33114b9537b50477d5d6980995eec6cc5c /codegen/lib/code/packet.py
parent56f98c1b243d1ba8906ac73a2f2d8eec5646183e (diff)
parent0a945e73ec43b3b0389e004e138c83f41cddc532 (diff)
downloadazalea-drasl-f414aa4d37e0c6a7adf55b772fa93714be6e9c9c.tar.xz
Merge pull request #9 from mat-1/azalea-block
azalea-block
Diffstat (limited to 'codegen/lib/code/packet.py')
-rw-r--r--codegen/lib/code/packet.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py
index 36e0ba0c..2aabf39a 100644
--- a/codegen/lib/code/packet.py
+++ b/codegen/lib/code/packet.py
@@ -1,6 +1,6 @@
-from .utils import burger_type_to_rust_type, write_packet_file
-from ..utils import padded_hex, to_snake_case, to_camel_case
-from ..mappings import Mappings
+from lib.code.utils import burger_type_to_rust_type, write_packet_file
+from lib.utils import padded_hex, to_snake_case, to_camel_case, get_dir_location
+from lib.mappings import Mappings
import os
@@ -74,7 +74,8 @@ def generate_packet(burger_packets, mappings: Mappings, target_packet_id, target
'\n'.join(generated_packet_code))
print()
- mod_rs_dir = f'../azalea-protocol/src/packets/{state}/mod.rs'
+ mod_rs_dir = get_dir_location(
+ f'../azalea-protocol/src/packets/{state}/mod.rs')
with open(mod_rs_dir, 'r') as f:
mod_rs = f.read().splitlines()