Create

Create

86M Downloads

Fluid Pumps place less fluids than drained when draining from an IFluidHandler with multiple tanks containing the same fluid type.

Lightman314 opened this issue ยท 2 comments

commented

Explaination:
I'm in the process of making a fluid trading expansion for my currency mod, and your pumps are causing fluid loss when draining fluids from fluid traders when they have multiple trades (fluid tanks) containing the same fluid. This might just be an unexpected event on your side, as there are rarely singular fluid handlers that have multiple tanks (IFluidHandler.getTanks()), but even so, the drain/fill functions on my fluid handler function exactly as intended, and have been tested on another mods pump (Mr. Crayfish's Vehicle Mod's pump to be precise), and they work as intended with their pumps.

Details:
For some more details about my mod that could be exacerbating the issue, my fluid traders have multiple tanks (1 for each trade), but they can only be drained from via pump when a purchase has been made, whereas a pendingDrain value is stored, and when the drain function is run, the pendingDrain amount is shrunk based on the amount successfully drained (only during a FluidAction.EXECUTE of course) until such a time that the pending drain is fulfilled. The weird thing about this issue, is that the create pump works perfectly fine when the 4 tanks have 4 different fluids, but if the 4 tanks have the same fluid, even if draining is disabled for all but a singular tank, it will drain the full amount from my tank, but only place approximately 1/X of the drained fluid into the output tank (where X is the amount of tanks containing the same fluid).

Attempted Fixes:
I have managed to make some partial workarounds on my end by hiding the non-drainable trades from the getTankContents function, but the fact that the results of the getTankContents function has any impact on the amount of fluid output by the pump is very questionable, as only the fluids actually drained or filled via the drain/fill functions should have any impact on the fluids placed into the output tank(s).

If you would like to see the relevant source code from my mod just to confirm that there's nothing wrong with my fluid handler, you can find them here, here, and here, but I've double and triple-checked my code to confirm that there aren't any issues with how my fluid handler works.
My friend and I also recorded a video explaining/demonstrating the issue that can be watched here.

commented

This issue has been marked as stale because it has been inactive for 3 weeks. It will be closed if it remains inactive for another 3 weeks.

commented

This issue has been closed since it has been inactive for 3 weeks since it was marked as stale.