Models for the book items are not working (or I'm doing something wrong)
Eladkay opened this issue ยท 11 comments
Using GuideAPI.setModel(book); for a confirmed nonnull book doesn't set its texture, it stays a missing texture (and there are no errors in the log).
When I tried to specify my own texture (GuideAPI.setModel(book, new ModelResourceLocation(LibMisc.MOD_ID + ":" + LibNames.BOOK), "inventory");) I was presented with a similar issue, but something weird happened: the book still displayed a missing texture, and there's no log errors, but when I changed the name of the texture to a nonexistent one, I did get an error in the log, proving that the model IS referenced.
My thoughts are that it's something stupid like forgetting that arrays are 0 indexed or something. It's more likely I'm doing something wrong though.
Here is my model:
{
"parent": "item/generated",
"textures": {
"layer0": "quaritum:items/book"
}
}
No I am not, I'm registering it after the rest of the book in init, and for some reason the game crashes when I try to register my book on preinit. I'll get you a crash report, one sec.
Hm, that looks like an issue I fixed a while ago. Could I see all the relevant classes?
ModBook:
https://github.com/Eladkay/quaritum/blob/master/src/main/java/eladkay/quaritum/common/book/ModBook.java
CommonProxy:
https://github.com/Eladkay/quaritum/blob/master/src/main/java/eladkay/quaritum/common/core/CommonProxy.java
Quartium:
https://github.com/Eladkay/quaritum/blob/master/src/main/java/eladkay/quaritum/common/Quartium.java
I think that's all the relevant classes.
Update: I had to do some questionably valid things to get this to work, I made a new book item registered along with the regular guide-api item. That doesn't seem like the sort of things I was supposed to do. Thanks for helping though :P
I'm... not really sure. Here's how we do it in BloodMagic.
The book and model are registered in pre with empty categories. Then in post we build the categories.
Yeah no creating your own item will do nothing. And the BM method is neither redundant nor complicated. Models must be registered in pre. To register the model for a book, the book must be registered. However, not all of our content is registered in pre, so we handle that later on.