diff options
| author | Shayne Hartford <shaybox@shaybox.com> | 2024-10-21 20:21:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-21 19:21:38 -0500 |
| commit | cd2f298a62819a3fabc52ef17560c2124a74d555 (patch) | |
| tree | 3e32e4ccc7d9f095696c8e23b688b06cf1188f76 /azalea/src/container.rs | |
| parent | 5535877a4bddcdc30ef8f752a90e6845b308c3c2 (diff) | |
| download | azalea-drasl-cd2f298a62819a3fabc52ef17560c2124a74d555.tar.xz | |
Rename InventoryComponent to Inventory to match other components (#177)
(cherry picked from commit 266058a8d441169b46ef819595eee62337ab324c)
Diffstat (limited to 'azalea/src/container.rs')
| -rw-r--r-- | azalea/src/container.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/azalea/src/container.rs b/azalea/src/container.rs index c354390e..c9283b6b 100644 --- a/azalea/src/container.rs +++ b/azalea/src/container.rs @@ -1,7 +1,7 @@ use std::fmt::Formatter; use azalea_client::{ - inventory::{CloseContainerEvent, ContainerClickEvent, InventoryComponent}, + inventory::{CloseContainerEvent, ContainerClickEvent, Inventory}, packet_handling::game::PacketEvent, Client, }; @@ -65,9 +65,7 @@ impl ContainerClientExt for Client { } let ecs = self.ecs.lock(); - let inventory = ecs - .get::<InventoryComponent>(self.entity) - .expect("no inventory"); + let inventory = ecs.get::<Inventory>(self.entity).expect("no inventory"); if inventory.id == 0 { None } else { @@ -87,9 +85,7 @@ impl ContainerClientExt for Client { /// and [`Menu::slots`]. fn open_inventory(&mut self) -> Option<ContainerHandle> { let ecs = self.ecs.lock(); - let inventory = ecs - .get::<InventoryComponent>(self.entity) - .expect("no inventory"); + let inventory = ecs.get::<Inventory>(self.entity).expect("no inventory"); if inventory.id == 0 { Some(ContainerHandle::new(0, self.clone())) @@ -105,9 +101,7 @@ impl ContainerClientExt for Client { /// your own inventory. fn get_open_container(&self) -> Option<ContainerHandleRef> { let ecs = self.ecs.lock(); - let inventory = ecs - .get::<InventoryComponent>(self.entity) - .expect("no inventory"); + let inventory = ecs.get::<Inventory>(self.entity).expect("no inventory"); if inventory.id == 0 { None @@ -157,7 +151,7 @@ impl ContainerHandleRef { pub fn menu(&self) -> Option<Menu> { let ecs = self.client.ecs.lock(); let inventory = ecs - .get::<InventoryComponent>(self.client.entity) + .get::<Inventory>(self.client.entity) .expect("no inventory"); // this also makes sure we can't access the inventory while a container is open |
