fix issues
This commit is contained in:
parent
67dd35e0cb
commit
bae9198980
@ -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
|
/// 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) {
|
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>(
|
pub fn set_container_property<T: WindowPropertyTrait>(
|
||||||
@ -97,6 +98,7 @@ impl Player {
|
|||||||
window_property: WindowProperty<T>,
|
window_property: WindowProperty<T>,
|
||||||
) {
|
) {
|
||||||
let (id, value) = window_property.into_packet();
|
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
|
// Reads the connection until our buffer of len 4096 is full, then decode
|
||||||
/// Close connection when an error occurs
|
/// Close connection when an error occurs
|
||||||
pub async fn poll(&mut self, event: &Event) {
|
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) {
|
pub fn handle_close_container(&mut self, _server: &mut Server, packet: SCloseContainer) {
|
||||||
// window_id 0 represents both 9x1 Generic AND inventory here
|
// window_id 0 represents both 9x1 Generic AND inventory here
|
||||||
let Some(_window_type) = WindowType::from_u8(packet.window_id) else {
|
let Some(_window_type) = WindowType::from_u8(packet.window_id) else {
|
||||||
self.kick("Invalid window ID");
|
self.kick(TextComponent::text("Invalid window ID"));
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user