diff --git a/pumpkin-protocol/src/server/play/s_close_container.rs b/pumpkin-protocol/src/server/play/s_close_container.rs index 5ba6a5698..564151168 100644 --- a/pumpkin-protocol/src/server/play/s_close_container.rs +++ b/pumpkin-protocol/src/server/play/s_close_container.rs @@ -1,7 +1,7 @@ use pumpkin_macros::packet; -use serde::Serialize; +use serde::Deserialize; -#[derive(Serialize)] +#[derive(Deserialize)] #[packet(0x0F)] pub struct SCloseContainer { pub window_id: u8, diff --git a/pumpkin/src/client/mod.rs b/pumpkin/src/client/mod.rs index 8edca66c7..71c49990d 100644 --- a/pumpkin/src/client/mod.rs +++ b/pumpkin/src/client/mod.rs @@ -28,8 +28,8 @@ use pumpkin_protocol::{ handshake::SHandShake, login::{SEncryptionResponse, SLoginAcknowledged, SLoginPluginResponse, SLoginStart}, play::{ - SChatCommand, SChatMessage, SClientInformationPlay, SConfirmTeleport, SInteract, - SPlayPingRequest, SPlayerAction, SPlayerCommand, SPlayerPosition, + SChatCommand, SChatMessage, SClientInformationPlay, SCloseContainer, SConfirmTeleport, + SInteract, SPlayPingRequest, SPlayerAction, SPlayerCommand, SPlayerPosition, SPlayerPositionRotation, SPlayerRotation, SSetCreativeSlot, SSetHeldItem, SSwingArm, SUseItemOn, }, @@ -312,6 +312,9 @@ impl Client { SPlayPingRequest::PACKET_ID => { self.handle_play_ping_request(server, SPlayPingRequest::read(bytebuf).unwrap()) } + SCloseContainer::PACKET_ID => { + self.handle_close_container(server, SCloseContainer::read(bytebuf).unwrap()) + } _ => log::error!("Failed to handle player packet id {:#04x}", packet.id.0), } } diff --git a/pumpkin/src/client/player_packet.rs b/pumpkin/src/client/player_packet.rs index 70522718a..27fe5e94c 100644 --- a/pumpkin/src/client/player_packet.rs +++ b/pumpkin/src/client/player_packet.rs @@ -420,7 +420,7 @@ impl Client { // TODO: // This function will in the future be used to keep track of if the client is in a valid state. // But this is not possible yet - pub fn handle_close_container(&mut self, packet: SCloseContainer) { + pub fn handle_close_container(&mut self, _server: &mut Server, packet: SCloseContainer) { // window_id 0 represents both 9x1 Generic AND inventory here let Ok(_window_type) = WindowType::try_from(packet.window_id) else { self.kick("Invalid window ID");