aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/container.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-05-06 18:38:23 -0545
committermat <git@matdoes.dev>2026-05-07 08:05:58 -1200
commitcabc8b60a729ba17f5b75f7a7956c6d1ddcc8919 (patch)
tree237fd12a9768fe7431ce42dfbdde60f4c7850e06 /azalea/src/container.rs
parent9ffd0e80bbb3feace231553d6539124585b03e3c (diff)
downloadazalea-drasl-cabc8b60a729ba17f5b75f7a7956c6d1ddcc8919.tar.xz
azalea-brigadier now allows commands to return a Result
Diffstat (limited to 'azalea/src/container.rs')
-rw-r--r--azalea/src/container.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/azalea/src/container.rs b/azalea/src/container.rs
index 0a5c8c01..1a8b1721 100644
--- a/azalea/src/container.rs
+++ b/azalea/src/container.rs
@@ -37,14 +37,14 @@ impl Client {
///
/// ```
/// # use azalea::{prelude::*, registry::builtin::BlockKind};
- /// # async fn example(mut bot: azalea::Client) -> AzaleaResult<()> {
+ /// # async fn example(mut bot: azalea::Client) -> azalea::error::AzaleaResult<()> {
/// let target_pos = bot
- /// .world()
+ /// .world()?
/// .read()
- /// .find_block(bot.position(), &BlockKind::Chest.into());
+ /// .find_block(bot.position()?, &BlockKind::Chest.into());
/// let Some(target_pos) = target_pos else {
/// bot.chat("no chest found");
- /// return;
+ /// return Ok(());
/// };
/// let container = bot.open_container_at(target_pos).await?;
/// # Ok(())
@@ -256,11 +256,12 @@ impl ContainerHandleRef {
///
/// ```no_run
/// # use azalea::prelude::*;
- /// # fn example(bot: &Client) {
- /// let inventory = bot.get_inventory();
+ /// # fn example(bot: &Client) -> azalea::error::AzaleaResult<()> {
+ /// let inventory = bot.get_inventory()?;
/// let inventory_title = inventory.title().unwrap_or_default().to_string();
/// // would be true if an unnamed chest is open
/// assert_eq!(inventory_title, "Chest");
+ /// # Ok(())
/// # }
/// ```
pub fn title(&self) -> Option<FormattedText> {