Fix fluid networks sometimes failing to rebuild in long pipelines#10603
Open
Apertyotis wants to merge 1 commit into
Open
Fix fluid networks sometimes failing to rebuild in long pipelines#10603Apertyotis wants to merge 1 commit into
Apertyotis wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mechanicalPumpRangeis16, 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
mechanicalPumpRangebeyond64, 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.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.