add method to set container property
This commit is contained in:
1 file changed
+7
-1
@@ -1,6 +1,7 @@
|
|||||||
use pumpkin_core::text::TextComponent;
|
use pumpkin_core::text::TextComponent;
|
||||||
|
use pumpkin_inventory::window_property::{WindowProperty, WindowPropertyTrait};
|
||||||
use pumpkin_inventory::WindowType;
|
use pumpkin_inventory::WindowType;
|
||||||
use pumpkin_protocol::client::play::{CCloseContainer, COpenScreen, CSetContainerContent, CSetContainerSlot};
|
use pumpkin_protocol::client::play::{CCloseContainer, COpenScreen, CSetContainerContent, CSetContainerProperty, CSetContainerSlot};
|
||||||
use pumpkin_protocol::slot::Slot;
|
use pumpkin_protocol::slot::Slot;
|
||||||
use pumpkin_world::item::Item;
|
use pumpkin_world::item::Item;
|
||||||
|
|
||||||
@@ -90,4 +91,9 @@ impl super::Client {
|
|||||||
) {
|
) {
|
||||||
self.send_packet(&CCloseContainer::new(window_type as u8))
|
self.send_packet(&CCloseContainer::new(window_type as u8))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_container_property<T: WindowPropertyTrait>(&mut self, window_type: WindowType, window_property: WindowProperty<T>) {
|
||||||
|
let (id,value) = window_property.into_packet();
|
||||||
|
self.send_packet(&CSetContainerProperty::new(window_type as u8,id,value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user