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
Open
Fix fluid duplication caused by valve pipes and smart pipes not updating correctly#10001Apertyotis wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
Apertyotis wants to merge 1 commit intoCreators-of-Create:mc1.21.1/devfrom
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.
Issue
Recently, the community discovered a very simple method to duplicate fluids in Create:
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
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
neighborChangedby validating the update and, if valid, propagating changes to the fluid network. However, when placing breakpoints insideneighborChangedfor Fluid Valve and Smart Fluid Pipe, I found that their updates always fail validation:FluidValveBlock.java#L118
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 theIAxisPipeinterface. As a result, the fluid network is not properly updated.FluidPropagator.java#L216