Unable to pump fluid source blocks into flowing fluids of the same type #5884
Labels
status: fixed in next release
Issue will be fixed in the next release
type: bug
Issue where something isn't working
Describe the Bug
When pumping fluids out of empty pipes, the usual behaviour is to place a source block of that fluid in the space infront of the open end of the pipe — if the space is empty. If a the target block instead has a flowing fluid of the same type, then the pipe will not place a source block.
Reproduction Steps
With water, but the same is true for any fluid:
Expected Result
The flowing fluid in the space infront of the pump is replaced with a fluid source block.
Screenshots and Videos
A screenshot of the test setup for water:
Same for lava:
Same for honey:
Crash Report or Log
N/A
Operating System
macOS
Mod Version
0.5.1f
Minecraft Version
1.20.1
Forge Version
NeoForge 47.1.83
Other Mods
None.
Additional Context
Having searched through the code, I believe this is because of the fluid collision check.
In the method provideFluidToSpace, Create gets both the fluid of the pipe (as the local variable
fluid
) and the "fluid state" of the target block (asfluidState
). One of the checks done is to decide if two different fluids are "colliding", and call the fluid collision behaviour if so:The issue is that "water" and "flowing water" are two different fluids. So when
fluid.getFluid()
(i.e., the fluid in the pipe) is "water" andfluidState.getType()
is "flowing water", this check considers them to be different and calls out to thehandlePipeSpillCollision
. That method has no handling code for water interacting with flowing water, so nothing happens.(Interestingly something different happens for Milk, as there is a special case for milk before we get to this check. But the end result there is that the milk is drained from the pipe but a source block isn't placed.)
One possible solution is to repalce this check with:
Here the existing convertToStill method is used to consider only the still variant of the fluid in the output block. I tested this in the Fabric version of Create (as that's where I found this), but I think the code is the same in both Forge and Fabric versions.
The text was updated successfully, but these errors were encountered: