Add some v1.16.5, v1.17, v1.17.1 types

This commit is contained in:
timvisee
2021-11-23 00:20:30 +01:00
parent 6d1ef0b27d
commit 692a88c16b
13 changed files with 342 additions and 349 deletions

View File

@@ -1,4 +1,6 @@
pub mod v1_14_4;
pub mod v1_16_5;
pub mod v1_17;
pub mod v1_17_1;
/// Trait to obtain packet ID from packet data.
@@ -8,11 +10,15 @@ pub trait PacketId {
}
#[macro_export]
macro_rules! trait_packet_id (
macro_rules! set_packet_id (
($type: ident, $id: expr) => (
impl $type {
const PACKET_ID: u8 = $id;
}
impl PacketId for $type {
fn packet_id(&self) -> u8 {
$id
Self::PACKET_ID
}
}
)