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.
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 :(
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
:https://github.com/Sinytra/ForgifiedFabricAPI/blob/641809b69d4f15991b9b090e828dff1c29d98a01/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/BakedModelManagerMixin.java#L50-L53
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 https://github.com/cc-tweaked/CC-Tweaked/issues/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 :(