diff options
| author | mat <git@matdoes.dev> | 2025-10-30 11:02:50 -0530 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-10-30 11:02:50 -0530 |
| commit | 03a496fc7d952b1136cb717f2e8d1ccfb798ee64 (patch) | |
| tree | e6b4d8052d9e622f741c35c9409e24b2a48436ce /azalea-entity/src/mining.rs | |
| parent | 818f2d01d49e574946d1a704e1445156afc9c2fb (diff) | |
| download | azalea-drasl-03a496fc7d952b1136cb717f2e8d1ccfb798ee64.tar.xz | |
cleanup some code related to mob effects
Diffstat (limited to 'azalea-entity/src/mining.rs')
| -rw-r--r-- | azalea-entity/src/mining.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/azalea-entity/src/mining.rs b/azalea-entity/src/mining.rs index 7c142020..2008da34 100644 --- a/azalea-entity/src/mining.rs +++ b/azalea-entity/src/mining.rs @@ -1,8 +1,8 @@ use azalea_block::{BlockBehavior, BlockTrait}; use azalea_core::tier::get_item_tier; -use azalea_registry as registry; +use azalea_registry::{self as registry, MobEffect}; -use crate::{ActiveEffects, FluidOnEyes, Physics, effects}; +use crate::{ActiveEffects, FluidOnEyes, Physics}; /// How much progress is made towards mining the block per tick, as a /// percentage. @@ -98,13 +98,11 @@ fn destroy_speed( // efficiency_level + 1) as f32; } // } - if let Some(dig_speed_amplifier) = effects::get_dig_speed_amplifier(active_effects) { + if let Some(dig_speed_amplifier) = active_effects.get_dig_speed_amplifier() { base_destroy_speed *= 1. + (dig_speed_amplifier + 1) as f32 * 0.2; } - if let Some(dig_slowdown) = - effects::get_effect(active_effects, registry::MobEffect::MiningFatigue) - { + if let Some(dig_slowdown) = active_effects.get_level(MobEffect::MiningFatigue) { let multiplier = match dig_slowdown { 0 => 0.3, 1 => 0.09, |
