diff options
| author | mat <git@matdoes.dev> | 2025-08-09 22:08:48 -0900 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-08-09 22:08:48 -0900 |
| commit | 3b659833c1ad4cca89b4cd553193edcb6d223163 (patch) | |
| tree | 6035c6797703dcf0b0240999bae34893f29cd9e8 /azalea/examples/testbot | |
| parent | 45cb5823f50ece7af86804d4331bd7ba2f6c5917 (diff) | |
| download | azalea-drasl-3b659833c1ad4cca89b4cd553193edcb6d223163.tar.xz | |
clippy
Diffstat (limited to 'azalea/examples/testbot')
| -rw-r--r-- | azalea/examples/testbot/commands/debug.rs | 24 | ||||
| -rw-r--r-- | azalea/examples/testbot/commands/movement.rs | 4 | ||||
| -rw-r--r-- | azalea/examples/testbot/main.rs | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/azalea/examples/testbot/commands/debug.rs b/azalea/examples/testbot/commands/debug.rs index d0d72b40..92a5b92e 100644 --- a/azalea/examples/testbot/commands/debug.rs +++ b/azalea/examples/testbot/commands/debug.rs @@ -42,7 +42,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { return 0; }; let position = source.bot.entity_component::<Position>(entity); - source.reply(&format!( + source.reply(format!( "You are at {}, {}, {}", position.x, position.y, position.z )); @@ -56,7 +56,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { return 0; }; let entity_id = source.bot.entity_component::<MinecraftEntityId>(entity); - source.reply(&format!( + source.reply(format!( "Your Minecraft ID is {} and your ECS id is {entity:?}", *entity_id )); @@ -66,7 +66,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { let whereareyou = |ctx: &Ctx| { let source = ctx.source.lock(); let position = source.bot.position(); - source.reply(&format!( + source.reply(format!( "I'm at {}, {}, {}", position.x, position.y, position.z )); @@ -77,7 +77,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { commands.register(literal("whoareyou").executes(|ctx: &Ctx| { let source = ctx.source.lock(); - source.reply(&format!( + source.reply(format!( "I am {} ({})", source.bot.username(), source.bot.uuid() @@ -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>(); - source.reply(&format!( + source.reply(format!( "I'm looking at {}, {}", direction.y_rot, direction.x_rot )); @@ -99,7 +99,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { let source = ctx.source.lock(); let health = source.bot.health(); - source.reply(&format!("I have {health} health")); + source.reply(format!("I have {health} health")); 1 })); @@ -116,11 +116,11 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { } let block_pos = r.block_pos; let block = source.bot.world().read().get_block_state(block_pos); - source.reply(&format!("I'm looking at {block:?} at {block_pos:?}")); + source.reply(format!("I'm looking at {block:?} at {block_pos:?}")); } HitResult::Entity(r) => { let entity_kind = *source.bot.entity_component::<EntityKindComponent>(r.entity); - source.reply(&format!( + source.reply(format!( "I'm looking at {entity_kind} ({:?}) at {}", r.entity, r.location )); @@ -139,7 +139,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { 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:?}")); + source.reply(format!("Block at {block_pos} is {block:?}")); 1 })), ))); @@ -152,7 +152,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { println!("getfluid xyz {x} {y} {z}"); let block_pos = BlockPos::new(x, y, z); let block = source.bot.world().read().get_fluid_state(block_pos); - source.reply(&format!("Fluid at {block_pos} is {block:?}")); + source.reply(format!("Fluid at {block_pos} is {block:?}")); 1 })), ))); @@ -164,7 +164,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { source.reply("I don't have the Pathfinder ocmponent"); return 1; }; - source.reply(&format!( + source.reply(format!( "pathfinder.is_calculating: {}", pathfinder.is_calculating )); @@ -174,7 +174,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { source.reply("I'm not executing a path"); return 1; }; - source.reply(&format!( + source.reply(format!( "is_path_partial: {}, path.len: {}, queued_path.len: {}", executing_path.is_path_partial, executing_path.path.len(), diff --git a/azalea/examples/testbot/commands/movement.rs b/azalea/examples/testbot/commands/movement.rs index 36ff42ff..89be3d0c 100644 --- a/azalea/examples/testbot/commands/movement.rs +++ b/azalea/examples/testbot/commands/movement.rs @@ -141,7 +141,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { tokio::time::sleep(Duration::from_secs_f32(seconds)).await; bot.walk(WalkDirection::None); }); - source.reply(&format!("ok, walking for {seconds} seconds")); + source.reply(format!("ok, walking for {seconds} seconds")); 1 })), ); @@ -155,7 +155,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { tokio::time::sleep(Duration::from_secs_f32(seconds)).await; bot.walk(WalkDirection::None); }); - source.reply(&format!("ok, spriting for {seconds} seconds")); + source.reply(format!("ok, spriting for {seconds} seconds")); 1 })), ); diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index 8fb96411..249f7b92 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -168,7 +168,7 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Resu chat: chat.clone(), state: state.clone(), }; - command_source.reply(&format!("{err:?}")); + command_source.reply(format!("{err:?}")); } } } |
