Skip to content

Fix fluid networks sometimes failing to rebuild in long pipelines#10603

Open
Apertyotis wants to merge 1 commit into
Creators-of-Create:mc1.21.1/devfrom
Apertyotis:fix/long-pipe-network-rebuild
Open

Fix fluid networks sometimes failing to rebuild in long pipelines#10603
Apertyotis wants to merge 1 commit into
Creators-of-Create:mc1.21.1/devfrom
Apertyotis:fix/long-pipe-network-rebuild

Conversation

@Apertyotis

Copy link
Copy Markdown
Contributor

The following content is machine-translated and may contain inaccuracies.

A Mechanical Pump scans the connected pipe network to locate its target and applies pressure to the discovered path. However, if a pipe leads into an unloaded chunk, the search simply skips it, even if a valid target exists beyond it.

One detail is that the default value of mechanicalPumpRange is 16, meaning a pump and its target can be at most one chunk apart. When a pump is placed near the edge of a loaded chunk, it can still discover the tank located in the neighboring chunk. Because that chunk is loaded as a border chunk and remains accessible in memory.

The issue becomes reproducible by increasing mechanicalPumpRange beyond 64, setting the simulation and render distances to their minimum values, placing a tank 64 blocks away from the pump, and connecting them while moving from the tank toward the pump. And then the pump never discovers the distant tank.

Note: Perform this experiment far from the world spawn, as spawn chunks are remaining loaded.

This PR marks pipe connections that terminate at unloaded chunks during the pump's search. When those chunks are later loaded, the marked boundary pipes trigger another fluid network update.

After this change, simply loading the missing chunks by moving into the middle of the pipeline allows the entire fluid network to rebuild correctly.

after.mp4

Although the experiment above requires increasing mechanicalPumpRange, I believe that real pipe networks can be much more complex, and the same chunk-loading problem may still occur with the default range. The scenario shown here is simply the easiest one to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant