aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples
diff options
context:
space:
mode:
Diffstat (limited to 'azalea/examples')
-rw-r--r--azalea/examples/testbot.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs
index c178a1d8..49243aa1 100644
--- a/azalea/examples/testbot.rs
+++ b/azalea/examples/testbot.rs
@@ -164,17 +164,17 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<
println!("inventory: {:?}", bot.menu());
}
"findblock" => {
- let target_pos = bot
- .world()
- .read()
- .find_block(bot.position(), &azalea::Block::DiamondBlock.into());
+ let target_pos = bot.world().read().find_block(
+ bot.position(),
+ &azalea::registry::Block::DiamondBlock.into(),
+ );
bot.chat(&format!("target_pos: {target_pos:?}",));
}
"gotoblock" => {
- let target_pos = bot
- .world()
- .read()
- .find_block(bot.position(), &azalea::Block::DiamondBlock.into());
+ let target_pos = bot.world().read().find_block(
+ bot.position(),
+ &azalea::registry::Block::DiamondBlock.into(),
+ );
if let Some(target_pos) = target_pos {
// +1 to stand on top of the block
bot.goto(BlockPosGoal::from(target_pos.up(1)));
@@ -183,10 +183,10 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<
}
}
"mineblock" => {
- let target_pos = bot
- .world()
- .read()
- .find_block(bot.position(), &azalea::Block::DiamondBlock.into());
+ let target_pos = bot.world().read().find_block(
+ bot.position(),
+ &azalea::registry::Block::DiamondBlock.into(),
+ );
if let Some(target_pos) = target_pos {
// +1 to stand on top of the block
bot.chat("ok mining diamond block");
@@ -201,7 +201,7 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<
let target_pos = bot
.world()
.read()
- .find_block(bot.position(), &azalea::Block::Lever.into());
+ .find_block(bot.position(), &azalea::registry::Block::Lever.into());
let Some(target_pos) = target_pos else {
bot.chat("no lever found");
return Ok(());
@@ -218,7 +218,7 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<
let target_pos = bot
.world()
.read()
- .find_block(bot.position(), &azalea::Block::Chest.into());
+ .find_block(bot.position(), &azalea::registry::Block::Chest.into());
let Some(target_pos) = target_pos else {
bot.chat("no chest found");
return Ok(());