BakedModelManagerMixin.getModel
mixin overwrites Forge's equivalent patch
#91
Labels
bug
Something isn't working
Describe the bug
Tested with:
Fabric API (and thus Forgified Fabric API) adds a method to
ModelManager
/BakedModelManagerMixin
to get the model from aResourceLocation
/Identifier
:ForgifiedFabricAPI/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/BakedModelManagerMixin.java
Lines 50 to 53 in 641809b
However, this shadows a similar method within Forge:
https://github.com/MinecraftForge/MinecraftForge/blob/45b00b000411d9c7b2e090359b051dc60a73628a/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch#L23-L25
While this would be fine, the two methods have different implementations - the Forge method is guaranteed to not return null, while the Fabric one does. This means that any mod which expects this method to not return null, will crash if the model cannot be loaded.
This has been seen in cc-tweaked/CC-Tweaked#1626, where (for unrelated reasons) a model could not be loaded, which caused a crash when trying to use that model.
Logs
No response
Additional context
Just to confirm that which method implementation was present in the class, I enabled mixin dumping in an environment with just Forgified Fabric API installed:
I wonder if it's worth having something as part of the build process which ensures that this does not happen again. Unfortunately I don't believe any of mixin's debug options will catch this :(
The text was updated successfully, but these errors were encountered: