Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LEVEL state to PotionFluid #2650

Merged
merged 1 commit into from
Dec 27, 2024
Merged

Conversation

loving2
Copy link
Contributor

@loving2 loving2 commented Dec 26, 2024

What

This PR changes the getAmount() method in PotionFluid to not return a static value of 0. It is needed so that calling defaultFluidState().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 in Cannot 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.

@loving2 loving2 requested a review from a team as a code owner December 26, 2024 05:41
@screret screret added the type: bugfix general bug fixes label Dec 26, 2024
Copy link
Member

@screret screret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it works..

@Ghostipedia Ghostipedia merged commit 4a05108 into GregTechCEu:1.20.1 Dec 27, 2024
3 of 4 checks passed
screret pushed a commit that referenced this pull request Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bugfix general bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fluid error / crash with GT 1.6.1 and Pneumaticcraft Repressurized
3 participants