diff --git a/pumpkin/src/client/container.rs b/pumpkin/src/client/container.rs index a2edae31c..80616d423 100644 --- a/pumpkin/src/client/container.rs +++ b/pumpkin/src/client/container.rs @@ -88,7 +88,8 @@ impl Player { /// The official Minecraft client is weird, and will always just close *any* window that is opened when this gets sent pub fn close_container(&mut self, window_type: WindowType) { - self.send_packet(&CCloseContainer::new(window_type as u8)) + self.client + .send_packet(&CCloseContainer::new(window_type as u8)) } pub fn set_container_property( @@ -97,6 +98,7 @@ impl Player { window_property: WindowProperty, ) { let (id, value) = window_property.into_packet(); - self.send_packet(&CSetContainerProperty::new(window_type as u8, id, value)); + self.client + .send_packet(&CSetContainerProperty::new(window_type as u8, id, value)); } } diff --git a/pumpkin/src/client/mod.rs b/pumpkin/src/client/mod.rs index ae5b7f650..5146a31f2 100644 --- a/pumpkin/src/client/mod.rs +++ b/pumpkin/src/client/mod.rs @@ -228,7 +228,6 @@ impl Client { } } - // Reads the connection until our buffer of len 4096 is full, then decode /// Close connection when an error occurs pub async fn poll(&mut self, event: &Event) { diff --git a/pumpkin/src/client/player_packet.rs b/pumpkin/src/client/player_packet.rs index 867b34475..b27af67cd 100644 --- a/pumpkin/src/client/player_packet.rs +++ b/pumpkin/src/client/player_packet.rs @@ -415,7 +415,7 @@ impl Player { pub fn handle_close_container(&mut self, _server: &mut Server, packet: SCloseContainer) { // window_id 0 represents both 9x1 Generic AND inventory here let Some(_window_type) = WindowType::from_u8(packet.window_id) else { - self.kick("Invalid window ID"); + self.kick(TextComponent::text("Invalid window ID")); return; }; }