aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples/testbot/commands/debug.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-12-24 08:48:36 +0000
committermat <git@matdoes.dev>2024-12-24 08:48:36 +0000
commitf03e0c22355778a9863cccb5a59d852278d60701 (patch)
treef02e7ca3d1e975d486071934a6322d372b7c9a02 /azalea/examples/testbot/commands/debug.rs
parentde5a53ce08de5b9d77bce99dd9ecde3171ebd74e (diff)
downloadazalea-drasl-f03e0c22355778a9863cccb5a59d852278d60701.tar.xz
fix parsing Dust particle and treat waterlogged blocks as liquid in pathfinder
Diffstat (limited to 'azalea/examples/testbot/commands/debug.rs')
-rw-r--r--azalea/examples/testbot/commands/debug.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/azalea/examples/testbot/commands/debug.rs b/azalea/examples/testbot/commands/debug.rs
index ae0808cb..ab323b2f 100644
--- a/azalea/examples/testbot/commands/debug.rs
+++ b/azalea/examples/testbot/commands/debug.rs
@@ -5,6 +5,7 @@ use azalea::{
entity::{LookDirection, Position},
interact::HitResultComponent,
world::MinecraftEntityId,
+ BlockPos,
};
use parking_lot::Mutex;
@@ -102,4 +103,18 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) {
1
}));
+
+ commands.register(literal("getblock").then(argument("x", integer()).then(
+ argument("y", integer()).then(argument("z", integer()).executes(|ctx: &Ctx| {
+ let source = ctx.source.lock();
+ let x = get_integer(ctx, "x").unwrap();
+ let y = get_integer(ctx, "y").unwrap();
+ let z = get_integer(ctx, "z").unwrap();
+ println!("getblock xyz {x} {y} {z}");
+ let block_pos = BlockPos::new(x, y, z);
+ let block = source.bot.world().read().get_block_state(&block_pos);
+ source.reply(&format!("Block at {block_pos:?} is {block:?}"));
+ 1
+ })),
+ )));
}