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

Partial gamerule support for FluidType#canConvertToSource of vanilla fluids #193

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

pupnewfster
Copy link
Member

Notes:

  1. In world the gamerules work fine even without this change as only ForgeFlowingFluid actually queries the FluidType#canConvertToSource and the two vanilla fluids fallback to calling the FlowingFluid#canConvertToSource(Level)
  2. This PR isn't perfectly accurate for cases when a LevelReader that is not a Level or for the FluidStack variant of canConvertToSource as in both of those cases we don't have access to gamerules so we just fallback to the default values of those gamerules (true for water and false for lava)

@sciwhiz12 sciwhiz12 added enhancement New (or improvement to existing) feature or request 1.20 Targeted at Minecraft 1.20 labels Oct 30, 2023
Copy link
Member

@sciwhiz12 sciwhiz12 left a comment

Choose a reason for hiding this comment

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

Looks fine to me.

Out of curiosity though, @ChampionAsh5357, do you remember why FluidType#canConvertToSource uses a LevelReader even though its two callers, IFluidExtension#canConvertToSource and BaseFlowingFluid#canConvertToSource both have Levels?

@sciwhiz12 sciwhiz12 enabled auto-merge (squash) November 1, 2023 07:58
@sciwhiz12 sciwhiz12 merged commit 7357532 into neoforged:1.20.x Nov 1, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.20 Targeted at Minecraft 1.20 enhancement New (or improvement to existing) feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants