neoforged / NeoForge

Neo Modding API for Minecraft, based on Forge
https://projects.neoforged.net/neoforged/neoforge
Other
1.05k stars 140 forks source link

`isEyeInFluid` needs to use a different return method call for vanilla returns #493

Open Tslat opened 6 months ago

Tslat commented 6 months ago

Similar to #492, Forge has failed in applying custom fluid properties properly here.

This method:

public boolean isEyeInFluid(TagKey<Fluid> pFluidTag) {
        if (pFluidTag == FluidTags.WATER) return this.isEyeInFluidType(net.neoforged.neoforge.common.NeoForgeMod.WATER_TYPE.value());
        else if (pFluidTag == FluidTags.LAVA) return this.isEyeInFluidType(net.neoforged.neoforge.common.NeoForgeMod.LAVA_TYPE.value());
        return this.fluidOnEyes.contains(pFluidTag);
}

This returns true if, and only if the fluid is vanilla water or lava, if tagged as water or lava. This is a massive issue for any fluid that is non-vanilla, but acts like water or lava.

For example, if I make a custom water fluid, and I tag it as water, this method will return false.

This can be resolved by just.. not returning early, and letting the last return statement be the only one there

TelepathicGrunt commented 6 months ago

Isn't this method deprecated? I believe the design of the fluid api was to unhook all these isEyeInFluid calls and substitute in isEyeInFluidType and do all logics with fluid types instead. Issue is the fluid api system is not fully implemented...

Tslat commented 6 months ago

It's deprecated in the same way the others in the fluid system are - they're annotated as such, but they're still hooked into so many places it's fundamentally meaningless