Guide-API

Guide-API

76M Downloads

[1.11.2] Guide-API not recognizing custom modded items

zxc74171 opened this issue ยท 2 comments

commented

MC version: 1.11.2
Guide-API version:1.11.2-2.1.1-52
Forge version:1.11.2-13.20.0.2315

Hello, recently I starting making a mod, and it heavily relies on Guide-API to tell its story.

I have been testing the mod for a while on Ecplise's dev environment, and everything's correct there. Icons render, recipes appear in game.

So I built the mod and test played it on a mulitimc 1.11.2 instance, with nothing but newest forge, Guide-API, and my mod installed.

In-game however, non of my mod's items render in the guidebooks(I have multiple books).
As entry/category icons, they simply disappear. As items in recipe pages, they become "Air" in output, and when it's in the recipe's input, it straight up crashes the book and make the whole book disappear,
All my items render fine in my mod, but not in Guide-API's books.

I checked the log of the game: Guide API is recognizing my mod items as "null". Here is one example:

[12:53:45] [Client thread/ERROR] [Guide-API]: Error registering book for class com.<PROFILE NAME>.thaumicpotatoes.GuideBook2
[12:53:45] [Client thread/INFO]: [STDERR]: java.lang.RuntimeException: Invalid shaped ore recipe: AB , CD ,    , A, null, B, null, C, net.minecraft.item.Item@3a4e524, D, net.minecraft.item.Item@5e67a490, 1xtile.air@0

And all of these only happen in game after I built the mod and installed it. In the dev environment, everything works as intended. I have been looking for solutions, but none work.

Does anyone have any idea how do I fix this?

commented

You are telling Forge to load your mod before GuideAPI with before:guideapi, right? If that's not the case, then since the mod list is sorted alphabetically, GuideAPI is running it's preInit phase (which collects and handles books) before your preInit phase (which would be where your items should be getting registered).

If that won't work for you, an alternative fix would be to add your guide content in IGuideBook#handlePost()

commented

Oh my, thanks for the quick and accurate reply. After adding dependencies:"before:guideapi" at my @mod, the items all render correctly in the game. Thank you so much for the help.

I appreciate your efforts in making this mod. This api helped me(and probably many others) a lot in creating books with simple GUIs. Good job!