mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
fix issues
This commit is contained in:
@@ -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>(
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user