From 839d536e8020b291bc1d213a5e8e823dc513a940 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 28 Dec 2025 09:06:47 -0330 Subject: add a few more functions for getting common components to Client --- azalea/src/container.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'azalea/src/container.rs') diff --git a/azalea/src/container.rs b/azalea/src/container.rs index 8b46994e..b4c98415 100644 --- a/azalea/src/container.rs +++ b/azalea/src/container.rs @@ -156,13 +156,13 @@ impl Client { /// /// To open a container in the world, use [`Client::open_container_at`]. pub fn get_inventory(&self) -> ContainerHandleRef { - self.query_self::<&Inventory, _>(|inv| ContainerHandleRef::new(inv.id, self.clone())) + ContainerHandleRef::new(self.component::().id, self.clone()) } /// Get the item in the bot's hotbar that is currently being held in its /// main hand. pub fn get_held_item(&self) -> ItemStack { - self.query_self::<&Inventory, _>(|inv| inv.held_item().clone()) + self.component::().held_item().clone() } } -- cgit v1.2.3