aboutsummaryrefslogtreecommitdiff
path: root/azalea
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-02-07 21:25:42 +0300
committermat <git@matdoes.dev>2026-02-07 05:48:18 -1245
commit8d718a627349bdf1e531fba318abc634a3bec9da (patch)
tree9b02cebd67e47dbccd986b2ec3d91781468464b4 /azalea
parent4bf82475c6a425bcf6f7d5880009fb9e47be998b (diff)
downloadazalea-drasl-8d718a627349bdf1e531fba318abc634a3bec9da.tar.xz
replace hard-coded block break speed checks
Diffstat (limited to 'azalea')
-rw-r--r--azalea/src/auto_tool.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/azalea/src/auto_tool.rs b/azalea/src/auto_tool.rs
index 519c5dc9..5fe0f529 100644
--- a/azalea/src/auto_tool.rs
+++ b/azalea/src/auto_tool.rs
@@ -2,7 +2,7 @@ use azalea_block::{BlockState, BlockTrait, fluid_state::FluidKind};
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 azalea_registry::builtin::{BlockKind, EntityKind};
use crate::Client;
@@ -92,13 +92,13 @@ pub fn accurate_best_tool_in_hotbar_for_block(
}
// find the first slot that has an item without durability
- for (i, item_slot) in hotbar_slots.iter().enumerate() {
+ for (i, item_stack_data) in hotbar_slots.iter().enumerate() {
let this_item_speed;
- match item_slot {
+ match item_stack_data {
ItemStack::Empty => {
this_item_speed = Some(azalea_entity::mining::get_mine_progress(
block.as_ref(),
- ItemKind::Air,
+ &ItemStack::Empty,
fluid_on_eyes,
physics,
attributes,
@@ -111,7 +111,7 @@ pub fn accurate_best_tool_in_hotbar_for_block(
if !item_stack.component_patch.has::<components::Damage>() {
this_item_speed = Some(azalea_entity::mining::get_mine_progress(
block.as_ref(),
- item_stack.kind,
+ item_stack_data,
fluid_on_eyes,
physics,
attributes,
@@ -131,11 +131,11 @@ pub fn accurate_best_tool_in_hotbar_for_block(
}
// now check every item
- for (i, item_slot) in hotbar_slots.iter().enumerate() {
- if let ItemStack::Present(item_slot) = item_slot {
+ for (i, item_stack) in hotbar_slots.iter().enumerate() {
+ if item_stack.is_present() {
let this_item_speed = azalea_entity::mining::get_mine_progress(
block.as_ref(),
- item_slot.kind,
+ item_stack,
fluid_on_eyes,
physics,
attributes,