aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--azalea/examples/steal.rs2
-rw-r--r--azalea/src/container.rs10
2 files changed, 6 insertions, 6 deletions
diff --git a/azalea/examples/steal.rs b/azalea/examples/steal.rs
index 87a1561b..71db1c68 100644
--- a/azalea/examples/steal.rs
+++ b/azalea/examples/steal.rs
@@ -68,7 +68,7 @@ async fn steal(bot: Client, state: State) -> anyhow::Result<()> {
bot.goto(RadiusGoal::new(chest_block.center(), 3.)).await;
- let Some(chest) = bot.open_container_at(chest_block).await else {
+ let Some(chest) = bot.open_container_at(chest_block, None).await else {
println!("Couldn't open chest at {chest_block:?}");
continue;
};
diff --git a/azalea/src/container.rs b/azalea/src/container.rs
index 2394551b..57d0b369 100644
--- a/azalea/src/container.rs
+++ b/azalea/src/container.rs
@@ -47,7 +47,7 @@ pub trait ContainerClientExt {
/// bot.chat("no chest found");
/// return;
/// };
- /// let container = bot.open_container_at(target_pos).await;
+ /// let container = bot.open_container_at(target_pos, None).await;
/// # }
/// ```
fn open_container_at(
@@ -134,10 +134,10 @@ impl ContainerClientExt for Client {
}
elapsed_ticks += 1;
- if let Some(timeout_ticks) = timeout_ticks {
- if elapsed_ticks >= timeout_ticks {
- return None;
- }
+ if let Some(timeout_ticks) = timeout_ticks
+ && elapsed_ticks >= timeout_ticks
+ {
+ return None;
}
}