diff options
| author | mat <git@matdoes.dev> | 2025-12-28 09:06:47 -0330 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-12-28 09:06:47 -0330 |
| commit | 839d536e8020b291bc1d213a5e8e823dc513a940 (patch) | |
| tree | 60cab8b908ad53af0126e2cb1dec670d073936a3 /azalea/src/container.rs | |
| parent | 5b1a78baf757897532be8c308a37c99fb2ca3352 (diff) | |
| download | azalea-drasl-839d536e8020b291bc1d213a5e8e823dc513a940.tar.xz | |
add a few more functions for getting common components to Client
Diffstat (limited to 'azalea/src/container.rs')
| -rw-r--r-- | azalea/src/container.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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::<Inventory>().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::<Inventory>().held_item().clone() } } |
