FluidRenderHandler support incompatible with fabrics default, can cause crash
QuImUfu opened this issue ยท 3 comments
Version information
sodium-fabric-mc1.19.4-0.4.10+build.24
Expected Behavior
When adding a FRAPI FluidRenderHandler overwriting the renderFluid method for completely custom fluid rendering and letting getFluidSprites (that might not make much sense for that fluid) from FluidRenderHandler return null/an empty array, the worst consequence should IMO be the fluid not rendering (properly).
Actual Behavior
When adding such a FluidRenderHandler, the game crashes with a java.util.concurrent.CompletionException
caused by a java.lang.NullPointerException
when placing those fluids.
Reproduction Steps
Write a mod adding a custom fluid with custom rendering, add Sodium, place the fluid and watch it crash.
Java version
Java 18
CPU
AMD Ryzen 5 3600
GPU
AMD Pitcairn XT [Radeon HD 7870 GHz Edition]
Additional information
Additionally, I would love to see a feature that allows fully custom Fluid Rendering with Sodium without a Mixin into Sodium.
Maybe an interface allowing a FluidRenderHandler to implement a renderFluidSodium
method that gets called by Sodium instead of Sodium's own rendering code when present?
This was fixed with commit 2272018.
letting getFluidSprites (that might not make much sense for that fluid) from FluidRenderHandler return null/an empty array
For what it's worth, some other mods might try to use the sprites to render your fluid in a GUI. So you should always provide the 2 textures if you provide a FluidRenderHandler
, even if you override rendeFluid
.
PS: Custom fluid models that work with Sodium are planned in Fabric, but that will take some time.