From b6ddde99eaf03466744bc4448bc3a4117ea2cd86 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 25 Jan 2025 22:16:59 +0000 Subject: add ProtocolPacket::name function --- azalea-protocol/src/packets/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'azalea-protocol/src/packets/mod.rs') diff --git a/azalea-protocol/src/packets/mod.rs b/azalea-protocol/src/packets/mod.rs index 24a1437c..5f28e340 100755 --- a/azalea-protocol/src/packets/mod.rs +++ b/azalea-protocol/src/packets/mod.rs @@ -44,6 +44,12 @@ where { fn id(&self) -> u32; + /// Returns Mojang's resource name for the packet. + /// + /// This doesn't include the "minecraft:" prefix, it just returns a string + /// like `pong`. + fn name(&self) -> &'static str; + /// Read a packet by its id, `ConnectionProtocol`, and flow fn read(id: u32, buf: &mut Cursor<&[u8]>) -> Result>; -- cgit v1.2.3