From 9513f42e87f64c409cdb2a100500a50e5a713bac Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sat, 27 Dec 2025 22:02:00 -0600 Subject: Move Client struct to azalea crate (#297) * move the Client struct out of azalea-client into azalea * actually add client impls in azalea --- azalea/src/auto_tool.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'azalea/src/auto_tool.rs') diff --git a/azalea/src/auto_tool.rs b/azalea/src/auto_tool.rs index 06103976..519c5dc9 100644 --- a/azalea/src/auto_tool.rs +++ b/azalea/src/auto_tool.rs @@ -1,11 +1,10 @@ use azalea_block::{BlockState, BlockTrait, fluid_state::FluidKind}; -use azalea_client::Client; use azalea_core::position::BlockPos; use azalea_entity::{ActiveEffects, Attributes, FluidOnEyes, Physics, inventory::Inventory}; use azalea_inventory::{ItemStack, Menu, components}; use azalea_registry::builtin::{BlockKind, EntityKind, ItemKind}; -use crate::bot::BotClientExt; +use crate::Client; #[derive(Debug)] pub struct BestToolResult { @@ -13,13 +12,8 @@ pub struct BestToolResult { pub percentage_per_tick: f32, } -pub trait AutoToolClientExt { - fn best_tool_in_hotbar_for_block(&self, block: BlockState) -> BestToolResult; - fn mine_with_auto_tool(&self, block_pos: BlockPos) -> impl Future + Send; -} - -impl AutoToolClientExt for Client { - fn best_tool_in_hotbar_for_block(&self, block: BlockState) -> BestToolResult { +impl Client { + pub fn best_tool_in_hotbar_for_block(&self, block: BlockState) -> BestToolResult { self.query_self::<( &Inventory, &Physics, @@ -41,7 +35,7 @@ impl AutoToolClientExt for Client { ) } - async fn mine_with_auto_tool(&self, block_pos: BlockPos) { + pub async fn mine_with_auto_tool(&self, block_pos: BlockPos) { let block_state = self .world() .read() -- cgit v1.2.3