Fluid Loader "Hold Empty" mode not working
jpastuszek opened this issue ยท 8 comments
In this mode I would expect that the tank cart will be send off if it has any amount of liquid. This is not happening and I have had this problem since few releases I think.
To reproduce just set up tank cart on top of "Boarding Mode" Locking Track and directly above it place Fluid Loader and set it to "Hold Empty". Now put bucket of water into Fluid Loader. What is happening is that cart will get all the water transferred but it won't get sent off.
No, this just means it will "Hold Empty" carts instead of sending them on immediately if the Loader has nothing to insert in the cart.
I used water buckets in this example but same goes with other liquids.
The Locking Track is in Boarding mode.
I have tried putting water directly into cart, into loader and into tank feeding the loader.
In all cases when cart was partially filled and there was no water anywhere else the cart was not sent off and it would be stopped after I have sent it off with the button.
The cart get set off the moment it gets fully loaded with any of this 3 methods and it won't be hold after it goes around.
Whatever I try the behaviour is identical to "Force Full".
I use version 9.4.0.0 and I have some other mods present like GrowCraft, Botania, OpenComputers etc... I don't have IC2 mod though.
OK, I see. But now this also does not work. Even if the cart has some fluid in it (not "Empty") it will still be "Hold".
And now if I push the button to make it go around:
It will still end up stopped even though it is not "Empty" any more.
So the "Hold Empty" at present == "Force Full" in it's behaviour.
Please try to reproduce.
What are you feeding the Loader with? If its trickling water into the Loader at a slow rate, the Loader will hold onto the cart until its full, so long as water is flowing.
I use the "Hold Emtpy" setting all the time and have never had issues.
Looking at the code this line should be true to sent cart in Hold Empty mode:
} else if (stateController.getButtonState() != ButtonState.FORCE_FULL && !tankCart.isTankEmpty(tank.getFluidType())) {
Since the tank is empty tank.getFluidType() looks like will return null. On null tankCart.isTankEmpty() is always true and thereof the whole expression will always be false.
So the behavior for Force Full mode is used instead.
tank.getFluidType() only returns null if the tank is empty (empty being defined as having a null or zero fluid). So 'true' is the correct result for tankCart.isTankEmpty(). If the tank is not empty (fluid not null + amount > 0), then tank.getFluidType() will not be null, and tankCart.isTankEmpty() will return false, making the entire expression true. This is behaving as intended.
Oh the its not the cart's tank that it is looking at, its the loader's. Hmm...I'm not entirely sure what the correct solution for that is.