diff options
| author | mat <github@matdoes.dev> | 2021-12-06 19:59:20 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-06 19:59:20 +0000 |
| commit | 0b484df40c356cf4fe87f3d3a20eadf59eef42c9 (patch) | |
| tree | 272b2ad58c7fc850378c5bc97eaae95a79277177 /minecraft-protocol/src/packets/mod.rs | |
| parent | 544c8a33940572eb7ad36eeafa94f8a64a1e23bc (diff) | |
| download | azalea-drasl-0b484df40c356cf4fe87f3d3a20eadf59eef42c9.tar.xz | |
implement new packet implementation
Diffstat (limited to 'minecraft-protocol/src/packets/mod.rs')
| -rw-r--r-- | minecraft-protocol/src/packets/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/minecraft-protocol/src/packets/mod.rs b/minecraft-protocol/src/packets/mod.rs index 2ccdeb44..bdb80c2f 100644 --- a/minecraft-protocol/src/packets/mod.rs +++ b/minecraft-protocol/src/packets/mod.rs @@ -1,6 +1,7 @@ -pub mod client_intention_packet; - -use std::collections::HashMap; +mod client_intention_packet; +pub use client_intention_packet::ClientIntentionPacket; +mod serverbound_status_request_packet; +pub use serverbound_status_request_packet::ServerboundStatusRequestPacket; use crate::friendly_byte_buf::FriendlyByteBuf; @@ -13,9 +14,8 @@ pub enum ConnectionProtocol { } pub trait Packet { - /// The id of the packet, this is always a byte in vanilla. - /// This might be bigger than a u8 if using modpacks with lots of custom packets? - const ID: u8; - + /// Get the id of the packet, this is always a byte. + fn get_id(&self) -> u8; + fn write(&self, friendly_byte_buf: &mut FriendlyByteBuf) -> (); } |
