From ebaf5128fbc87970b2ba1f6157e5da035ae379c8 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 28 Dec 2024 01:48:25 +0000 Subject: better pathfinder debug messages --- azalea/examples/testbot/commands/movement.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'azalea/examples/testbot') diff --git a/azalea/examples/testbot/commands/movement.rs b/azalea/examples/testbot/commands/movement.rs index 3c66fefa..b0adec8b 100644 --- a/azalea/examples/testbot/commands/movement.rs +++ b/azalea/examples/testbot/commands/movement.rs @@ -3,7 +3,7 @@ use std::time::Duration; use azalea::{ brigadier::prelude::*, entity::{EyeHeight, Position}, - pathfinder::goals::{BlockPosGoal, XZGoal}, + pathfinder::goals::{BlockPosGoal, RadiusGoal, XZGoal}, prelude::*, BlockPos, SprintDirection, WalkDirection, }; @@ -42,6 +42,24 @@ pub fn register(commands: &mut CommandDispatcher>) { 1 }), ))) + .then(literal("radius").then(argument("radius", float()).then( + argument("x", integer()).then(argument("y", integer()).then( + argument("z", integer()).executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + let radius = get_float(ctx, "radius").unwrap(); + let x = get_integer(ctx, "x").unwrap(); + let y = get_integer(ctx, "y").unwrap(); + let z = get_integer(ctx, "z").unwrap(); + println!("goto radius {radius}, position: {x} {y} {z}"); + source.reply("ok"); + source.bot.goto(RadiusGoal { + pos: BlockPos::new(x, y, z).center(), + radius, + }); + 1 + }), + )), + ))) .then(argument("x", integer()).then(argument("y", integer()).then( argument("z", integer()).executes(|ctx: &Ctx| { let source = ctx.source.lock(); -- cgit v1.2.3