From 0b484df40c356cf4fe87f3d3a20eadf59eef42c9 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 6 Dec 2021 19:59:20 +0000 Subject: implement new packet implementation --- minecraft-protocol/src/packets/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'minecraft-protocol/src/packets/mod.rs') 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) -> (); } -- cgit v1.2.3