@@ -21,15 +21,14 @@ import com.lambda.interaction.construction.context.BreakContext
2121import com.lambda.interaction.request.ActionInfo
2222import com.lambda.interaction.request.breaking.BreakInfo.BreakType.Primary
2323import com.lambda.interaction.request.breaking.BreakInfo.BreakType.Rebreak
24- import com.lambda.util.BlockUtils.calcItemBlockBreakingDelta
24+ import com.lambda.interaction.request.breaking.BreakManager.calcBreakDelta
2525import com.lambda.util.Describable
2626import com.lambda.util.NamedEnum
2727import com.lambda.util.OneSetPerTick
2828import net.minecraft.client.network.ClientPlayerEntity
2929import net.minecraft.client.network.ClientPlayerInteractionManager
3030import net.minecraft.client.world.ClientWorld
3131import net.minecraft.entity.ItemEntity
32- import net.minecraft.entity.player.PlayerEntity
3332import net.minecraft.item.ItemStack
3433import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket
3534import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action
@@ -115,11 +114,11 @@ data class BreakInfo(
115114 world.setBlockBreakingInfo(player.id, context.blockPos, stage)
116115 }
117116
118- private fun getBreakTextureProgress (player : PlayerEntity , world : ClientWorld ): Int {
117+ private fun getBreakTextureProgress (player : ClientPlayerEntity , world : ClientWorld ): Int {
119118 val swapMode = breakConfig.swapMode
120119 val item =
121120 if (swapMode.isEnabled() && swapMode != BreakConfig .SwapMode .Start ) swapStack else player.mainHandStack
122- val breakDelta = context.cachedState.calcItemBlockBreakingDelta (player, world, context.blockPos, item)
121+ val breakDelta = context.cachedState.calcBreakDelta (player, world, context.blockPos, breakConfig , item)
123122 val progress = (breakDelta * breakingTicks) / (getBreakThreshold() + (breakDelta * breakConfig.fudgeFactor))
124123 return if (progress > 0.0f ) (progress * 10.0f ).toInt().coerceAtMost(9 ) else - 1
125124 }
0 commit comments