From a9820dfd79bf24a0a6fcb2345aad6c79a21585a5 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 15 Apr 2025 22:04:43 -0430 Subject: make goto async and clean up some examples --- azalea/examples/testbot/commands/movement.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'azalea/examples/testbot') diff --git a/azalea/examples/testbot/commands/movement.rs b/azalea/examples/testbot/commands/movement.rs index a400809b..1596ce89 100644 --- a/azalea/examples/testbot/commands/movement.rs +++ b/azalea/examples/testbot/commands/movement.rs @@ -28,7 +28,9 @@ pub fn register(commands: &mut CommandDispatcher>) { return 0; }; source.reply("ok"); - source.bot.goto(BlockPosGoal(BlockPos::from(position))); + source + .bot + .start_goto(BlockPosGoal(BlockPos::from(position))); 1 }) .then(literal("xz").then(argument("x", integer()).then( @@ -38,7 +40,7 @@ pub fn register(commands: &mut CommandDispatcher>) { let z = get_integer(ctx, "z").unwrap(); println!("goto xz {x} {z}"); source.reply("ok"); - source.bot.goto(XZGoal { x, z }); + source.bot.start_goto(XZGoal { x, z }); 1 }), ))) @@ -52,7 +54,7 @@ pub fn register(commands: &mut CommandDispatcher>) { let z = get_integer(ctx, "z").unwrap(); println!("goto radius {radius}, position: {x} {y} {z}"); source.reply("ok"); - source.bot.goto(RadiusGoal { + source.bot.start_goto(RadiusGoal { pos: BlockPos::new(x, y, z).center(), radius, }); @@ -68,7 +70,7 @@ pub fn register(commands: &mut CommandDispatcher>) { let z = get_integer(ctx, "z").unwrap(); println!("goto xyz {x} {y} {z}"); source.reply("ok"); - source.bot.goto(BlockPosGoal(BlockPos::new(x, y, z))); + source.bot.start_goto(BlockPosGoal(BlockPos::new(x, y, z))); 1 }), ))), -- cgit v1.2.3