aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/container.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-04-04 16:05:06 -0430
committermat <git@matdoes.dev>2025-04-04 16:05:06 -0430
commit5fd57fd630bea256639332f117848d6f1fcfd132 (patch)
tree83e21595e69e24b3b1e8790dc630b79cf14a1777 /azalea/src/container.rs
parente99ae608b67ad3ff105666e619d04ca9385488e1 (diff)
downloadazalea-drasl-5fd57fd630bea256639332f117848d6f1fcfd132.tar.xz
don't require mut for functions in Client and add some more convenience functions
Diffstat (limited to 'azalea/src/container.rs')
-rw-r--r--azalea/src/container.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea/src/container.rs b/azalea/src/container.rs
index b5ed74cc..0ce0fc44 100644
--- a/azalea/src/container.rs
+++ b/azalea/src/container.rs
@@ -24,10 +24,10 @@ impl Plugin for ContainerPlugin {
pub trait ContainerClientExt {
fn open_container_at(
- &mut self,
+ &self,
pos: BlockPos,
) -> impl Future<Output = Option<ContainerHandle>> + Send;
- fn open_inventory(&mut self) -> Option<ContainerHandle>;
+ fn open_inventory(&self) -> Option<ContainerHandle>;
fn get_open_container(&self) -> Option<ContainerHandleRef>;
}
@@ -49,7 +49,7 @@ impl ContainerClientExt for Client {
/// let container = bot.open_container_at(target_pos).await;
/// # }
/// ```
- async fn open_container_at(&mut self, pos: BlockPos) -> Option<ContainerHandle> {
+ async fn open_container_at(&self, pos: BlockPos) -> Option<ContainerHandle> {
self.ecs
.lock()
.entity_mut(self.entity)
@@ -83,7 +83,7 @@ impl ContainerClientExt for Client {
/// If you just want to get the items in the player's inventory without
/// sending any packets, use [`Client::menu`], [`Menu::player_slots_range`],
/// and [`Menu::slots`].
- fn open_inventory(&mut self) -> Option<ContainerHandle> {
+ fn open_inventory(&self) -> Option<ContainerHandle> {
let ecs = self.ecs.lock();
let inventory = ecs.get::<Inventory>(self.entity).expect("no inventory");