diff options
| author | mat <git@matdoes.dev> | 2025-01-25 22:16:59 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-01-25 22:20:35 +0000 |
| commit | b6ddde99eaf03466744bc4448bc3a4117ea2cd86 (patch) | |
| tree | 8739dd4b8a148b477dd475755b7905e29c36dbd9 /azalea-protocol/src/packets/mod.rs | |
| parent | f2d8d4211bc9a70a4963513217d211c125a6b03f (diff) | |
| download | azalea-drasl-b6ddde99eaf03466744bc4448bc3a4117ea2cd86.tar.xz | |
add ProtocolPacket::name function
Diffstat (limited to 'azalea-protocol/src/packets/mod.rs')
| -rwxr-xr-x | azalea-protocol/src/packets/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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<Self, Box<ReadPacketError>>; |
