Dynamic Resources changes the behaviour of Fabric Api's `getModel()`
Estecka opened this issue ยท 2 comments
Bug Description
The class ModelManager
has two different overloads for getModel
:
The vanilla implementation takes a ModelResourceLocation
as argument, and falls back to returning a missing model.
Fabric Api's implementation takes a plain ResourceLocation
as argument, and falls back to returning null
.
When ModernFix's Dynamic Resources is enabled, Fabric Api's overload returns a missing model instead of null, which can throw off mods that rely on detecting missing models.
The context for this is similar to #433, but involves a different overload of getModel
. This time it will be trivial to work around this on my end, so there's no urgency to fix this, but I still thought this behaviour was worth documenting.
(And honnestly I have no idea why those two behave differently to begin with. I might just take this issue to Fabric Api as well.)
Reproduction Steps
- Install Enchants-CIT v1.0.0
- Search for enchanted books with the newest enchantments (e.g windburst)
- Without Dynamic Resources: the item uses the vanilla texture.
- With Dynamic Resources: the item has a missing texture.
Log File
I think my reply to this was lost in a GitHub outage (I attempted to reply, it seemed to have gone through, but GitHub went down minutes later). Anyway, what I had said before was that I looked into it, and it wasn't that trivial to emulate the behavior. I think it would be better to correct it on Fabric API's end. Generally the missing model is preferred over null
, as it will at least not crash.