diff options
| author | mat <git@matdoes.dev> | 2025-04-15 22:04:43 -0430 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-04-15 22:04:43 -0430 |
| commit | a9820dfd79bf24a0a6fcb2345aad6c79a21585a5 (patch) | |
| tree | a8e6290707fee0e1b18812aba599da74e7fc6eed /azalea/examples/testbot | |
| parent | 1a0c4e2de9e6d82d5efdfac2bab17a73c79fc466 (diff) | |
| download | azalea-drasl-a9820dfd79bf24a0a6fcb2345aad6c79a21585a5.tar.xz | |
make goto async and clean up some examples
Diffstat (limited to 'azalea/examples/testbot')
| -rw-r--r-- | azalea/examples/testbot/commands/movement.rs | 10 |
1 files changed, 6 insertions, 4 deletions
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<Mutex<CommandSource>>) { 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<Mutex<CommandSource>>) { 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<Mutex<CommandSource>>) { 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<Mutex<CommandSource>>) { 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 }), ))), |
