Skip to content

Fix NeoForge crashing when Fabric mods try calling isInFluid - #300

Merged
Su5eD merged 1 commit into
Sinytra:26.1.2from
cassiancc:fluid-interaction-fix
Oct 10, 2026
Merged

Su5eD merged 1 commit into
Sinytra:26.1.2from
cassiancc:fluid-interaction-fix

Conversation

@cassiancc

@cassiancc cassiancc commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

The Issue

Fabric mods will call methods like isInFluid or isEyeInFluid that operate off a TagKey<Fluid> fluid. In NeoForge, those methods were made completely nonfunctional and will throw, as they expect modders to have created a FluidType. FFAPI creates fluid types on behalf of Fabric fluids, and a similar method in CommonHooks was already patched for Fabric fluids.

The Proposal

This PR mixins the NeoForge patch to EntityFluidInteraction#getFluidTypeByTag to find the first fluid in a tag, and get its fluid type. I believe this should reflect the same intent Fabric modders are expecting when they call this method, and is certainly better than an outright crash.

Possible Side Effects

It's possible that when called on a tag that contains multiple fluids, this may result in only matching a single fluid type. Additional mixins could also be used on isEyeInFluid and isInFluid to have them check against every fluid type to see if any match.

Alternatives

NeoForge could not not patch the game to intentionally crash it when mods use vanilla methods. Just a thought.

Additional Notes

Fixes #299. I've been testing this with a patched version of Enderscape, but that needs further fixes in Connector to boot to the point where this crash can be seen.

@Su5eD
Su5eD merged commit ad2e8b5 into Sinytra:26.1.2 Oct 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fabric mods cannot query isEyeInFluid

2 participants