Skip to content

Fix fluid duplication caused by valve pipes and smart pipes not updating correctly#10001

Open
Apertyotis wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
Apertyotis:fix/fluid-duplicate
Open

Fix fluid duplication caused by valve pipes and smart pipes not updating correctly#10001
Apertyotis wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
Apertyotis:fix/fluid-duplicate

Conversation

@Apertyotis
Copy link
Copy Markdown
Contributor

Issue

Recently, the community discovered a very simple method to duplicate fluids in Create:

  1. Connect a Fluid Valve directly to a tank, and use a Mechanical Pump to transfer the fluid into another tank.
  2. Assemble the source tank onto a minecart and store it in player's inventory.

Cause

The root cause appears to be that during fluid network ticks, Create only checks whether the original source fluid capability still exists, but does not further validate its correctness or validity:

PipeConnection#L86

if (!source.isPresent() && !determineSource(world, pos))
	return;

Additionally, assembling the tank onto a minecart does not remove the corresponding fluid capability. This may or may not be intentional — I am not entirely sure.

The key issue, however, lies in whether adjacent pipes properly handle block updates.

All pipe blocks respond to neighborChanged by validating the update and, if valid, propagating changes to the fluid network. However, when placing breakpoints inside neighborChanged for Fluid Valve and Smart Fluid Pipe, I found that their updates always fail validation:

FluidValveBlock.java#L118

Direction d = FluidPropagator.validateNeighbourChange(state, world, pos, otherBlock, neighborPos, isMoving);
if (d == null)
	return;

Looking deeper into the validation logic, the code checks whether the updated block is a Pump, Glass Fluid Pipe, or a normal Pipe — but notably excludes Fluid Valve and Smart Fluid Pipe.

This happens because the implementation only checks for instances of AxisPipeBlock. Unfortunately, both Fluid Valve and Smart Fluid Pipe merely implement the IAxisPipe interface. As a result, the fluid network is not properly updated.

FluidPropagator.java#L216

if (state.getBlock() instanceof AxisPipeBlock)
	return state.getValue(AxisPipeBlock.AXIS);

@AyOhEe AyOhEe added pr type: fix PR fixes a bug pr flag: simple PR has minimal changes labels Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr flag: simple PR has minimal changes pr type: fix PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants