diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-12-27 22:02:00 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-27 22:02:00 -0600 |
| commit | 9513f42e87f64c409cdb2a100500a50e5a713bac (patch) | |
| tree | bb6aa8b6d50fddf967bcb1f759e023754ea84e49 /azalea/src/auto_tool.rs | |
| parent | 588902ba4a3965982bdd84d92b20c6f7613f3978 (diff) | |
| download | azalea-drasl-9513f42e87f64c409cdb2a100500a50e5a713bac.tar.xz | |
Move Client struct to azalea crate (#297)
* move the Client struct out of azalea-client into azalea
* actually add client impls in azalea
Diffstat (limited to 'azalea/src/auto_tool.rs')
| -rw-r--r-- | azalea/src/auto_tool.rs | 14 |
1 files changed, 4 insertions, 10 deletions
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<Output = ()> + 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() |
