Skip to content

Fix FluidIngredient::toJson#4714

Open
Mqrius wants to merge 1 commit intoGregTechCEu:1.20.1from
Mqrius:fluids-3
Open

Fix FluidIngredient::toJson#4714
Mqrius wants to merge 1 commit intoGregTechCEu:1.20.1from
Mqrius:fluids-3

Conversation

@Mqrius
Copy link
Contributor

@Mqrius Mqrius commented Mar 5, 2026

What

FluidIngredient::toJson had code to output either a single value, or an array of values, depending on what's in FluidIngredient.values. However, a missing else means it would always output an array.

Implementation Details

Put the array code inside an else

Outcome

Output json is a single value or an array as expected

How Was This Tested

Game compiles and runs

Additional Information

The fromJson already correctly handles the two cases

Potential Compatibility Issues

If any external code uses FluidIngredient::toJson and always expects an array, this change would break their code.
An alternative to this PR would be to explicitly always return an array.

@Mqrius Mqrius requested a review from a team as a code owner March 5, 2026 14:50
@github-actions github-actions bot added the 1.20.1 label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant