Fix ClassCastException with create 6.0.8.1. #610
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In fabric-create version 6.0.8.1 (see Fabricators-of-Create/Create@64b6788) they added explicit porting-lib FluidType objects which replace the ones normally fetched by porting-lib's getFluidType function. Only problem is that Kilt replaces this function with one returning the forge FluidType, so you get a ClassCastException. The easiest way I know to reproduce the issue is to install Immersive Engineering, since that causes a crash when loading a world.
This pull request resolves this by simply wrapping each FluidType in the AllFluids class in with the Forge FluidType.
It should be noted that this replaces the fluid types built into create. Let me know if you think I should handle everything in the getTypeOf instead (to keep the normal create fluid types in the constants as-is), or if I should keep it but add a fallback just in case some create addon decide to add their own fluids with a mixin into getTypeOf.
The crash when loading Kilt with Immersive Enegineering and Fabric Create 6.0.8.1: