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.
What
This PR changes the getAmount() method in PotionFluid to not return a static value of
0
. It is needed so that callingdefaultFluidState().createLegacyBlock().getBlock()
on the flowing potion fluid doesn't error.Implementation Details
Adds the IntegerProperty LEVEL to the fluid state with a default value of 7.
Outcome
The getAmount method of PotionFluid returns the value associated with the LEVEL property.
Resolves: #2644
Additional Information
When calling
defaultFluidState().createLegacyBlock().getBlock()
the fluid's getAmount() method is utilized to determine what value to set for an IntegerProperty that ranges from 0 to 15. If getAmount() returns 0, the value it attempts to set is 16 and results inCannot set property IntegerProperty{name=level, clazz=class java.lang.Integer, values=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]} to 16 on Block{minecraft:water}, it is not an allowed value
.I cannot say I understand this well if at all, but my rudimentary understanding is that a block is being constructed of flowing fluid, and the issue arises when the amount of flowing fluid is none.