diff options
| author | mat <git@matdoes.dev> | 2025-12-28 09:06:47 -0330 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-12-28 09:06:47 -0330 |
| commit | 839d536e8020b291bc1d213a5e8e823dc513a940 (patch) | |
| tree | 60cab8b908ad53af0126e2cb1dec670d073936a3 /azalea/examples/testbot/commands/debug.rs | |
| parent | 5b1a78baf757897532be8c308a37c99fb2ca3352 (diff) | |
| download | azalea-drasl-839d536e8020b291bc1d213a5e8e823dc513a940.tar.xz | |
add a few more functions for getting common components to Client
Diffstat (limited to 'azalea/examples/testbot/commands/debug.rs')
| -rw-r--r-- | azalea/examples/testbot/commands/debug.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea/examples/testbot/commands/debug.rs b/azalea/examples/testbot/commands/debug.rs index 711c3260..d75b4c0a 100644 --- a/azalea/examples/testbot/commands/debug.rs +++ b/azalea/examples/testbot/commands/debug.rs @@ -88,7 +88,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { commands.register(literal("getdirection").executes(|ctx: &Ctx| { let source = ctx.source.lock(); - let direction = source.bot.component::<LookDirection>(); + let direction = source.bot.direction(); source.reply(format!( "I'm looking at {}, {}", direction.y_rot(), @@ -108,9 +108,9 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { commands.register(literal("lookingat").executes(|ctx: &Ctx| { let source = ctx.source.lock(); - let hit_result = source.bot.component::<HitResultComponent>(); + let hit_result = source.bot.hit_result(); - match &**hit_result { + match &hit_result { HitResult::Block(r) => { if r.miss { source.reply("I'm not looking at anything"); @@ -242,7 +242,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { commands.register(literal("attributes").executes(|ctx: &Ctx| { let source = ctx.source.lock(); - let attributes = source.bot.component::<Attributes>(); + let attributes = source.bot.attributes(); println!("attributes: {attributes:?}"); 1 })); |
