From 4523900de44f66c3d965c2fdf93dda9e18d133d6 Mon Sep 17 00:00:00 2001 From: Edvin Bryntesson Date: Fri, 23 Aug 2024 11:51:51 +0200 Subject: [PATCH] add method to set container property --- pumpkin/src/client/container.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pumpkin/src/client/container.rs b/pumpkin/src/client/container.rs index ead7eb502..edec9f39e 100644 --- a/pumpkin/src/client/container.rs +++ b/pumpkin/src/client/container.rs @@ -1,6 +1,7 @@ use pumpkin_core::text::TextComponent; +use pumpkin_inventory::window_property::{WindowProperty, WindowPropertyTrait}; 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_world::item::Item; @@ -90,4 +91,9 @@ impl super::Client { ) { self.send_packet(&CCloseContainer::new(window_type as u8)) } + + pub fn set_container_property(&mut self, window_type: WindowType, window_property: WindowProperty) { + let (id,value) = window_property.into_packet(); + self.send_packet(&CSetContainerProperty::new(window_type as u8,id,value)); + } }