Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryntet committed Aug 24, 2024
1 parent 67dd35e commit bae9198
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions pumpkin/src/client/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: WindowPropertyTrait>(
Expand All @@ -97,6 +98,7 @@ impl Player {
window_property: WindowProperty<T>,
) {
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));
}
}
1 change: 0 additions & 1 deletion pumpkin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pumpkin/src/client/player_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
Expand Down

0 comments on commit bae9198

Please sign in to comment.