With this mod, mining buildings will return the items required to craft it instead of the actual entity being mined. Works with expensive/normal mode, and (probably) all mods.
If the player is carrying an empty barrel, replace it with the fluid barrel. If they are carrying a partially full barrel of the fluid, fill it. If they don't have space to store the fluid, alert them and cancel the mining, then they can do it again if they really want to void the fluid. Maybe make that alert/cancel optional?