Botania

Botania

133M Downloads

[API] Missing block models for subtiles

alexgeek opened this issue ยท 4 comments

commented

I've recently updated an old mod that uses Botania's API from 1.9.4 and now block models are missing. Items do render in hand and in JEI however.

When hitting this line I noticed that Loader will never accept my subtile as its resource domain is the name of my mod and the resource path is the name of the flower. Though it seems to be the same situation for Botania flowers (i.e. resource domain is "botania" not "botania_special" and resource path is the flower name too). I put a break point on this line in load method of SpecialFlowerModel loader and followed it down the rabbit hole. It seems the only difference between my flowers and Botania's is that mine are not already in the cache. In ModelLoaderRegistry the second line of the method getModel returns early when loading a Botania flower as it already exists in the cache:
if(cache.containsKey(location)) return cache.get(location);

Mine for some reason are not in the cache so it continues on and iterates all the available ICustomModelLoaders. Since the accepts method will never return true for the reasons stated above it just returns the default missing model.

I am registering the subtile, the subtile signature, adding it to the creative menu, and registering the subtile model. I've also stepped through the process method of SpecialFlowerModel and my flowers are picked up in this block with no errors. So something along the way is going wrong.

I'll continue to step through and see why my model is missing from the cache but anyone knows why this would occur ( @williewillus I think this bit was originally your code?) then please let me know.

Thanks,
AP

commented

Oh and it's probably worth mentioning that the floating versions of my flower render just fine.

commented

I'm a bit confused by what you're having trouble with, a subtile model or the main holder model?

SpecialFlowerModel is just a holder for all of the subtile baked models for the actual flower block to use, and botania_special:specialFlower is the name of that holder. Subtile authors shouldn't use or worry about it.

If process() picks your MRL up then it should be working. Recheck the MRL that you pass in to the API and make sure it's a valid location. idk, maybe things have changed since 1.9? I haven't changed this code since 1.8.x though.

commented

the accepts method should at least return for the vanilla loader so I'm thinking the path is malformed, what are you passing as the path?

commented

I'm having trouble with subtile flowers placed in the world. I get the missing model as it can't find the MRL in the cache like it does with Botania flowers. But floating flowers work fine in the world and the flower renders fine when rendering in the hand/inventory/JEI.

Ah just figured it out, looks like the cross_tinted model was moved into the shapes directory.
Just need to update all my subtile blockstates from:

  "model": "botania:cross_tinted",

to

  "model": "botania:shapes/cross_tinted",

Phew.

Thanks, will close this now.