Just Enough Items (JEI)

Just Enough Items (JEI)

392M Downloads

[1.16.5] Is there a way to delay the JEI reload?

Speiger opened this issue ยท 4 comments

commented

Hey I remember mezz saying that there will be a API to delay recipe reloading because it reloads WAY to early.

Why does it reload to early: It reloads after tags were synchronized leaving no room for custom synchronized plugins to send their data.

My current fix for this problem is: Force JEI to load twice. Ofc this has to happen for every mod i write sooooo yeah have 5-6 JEI reloads per recipe reload.
Now none recipe synchronized mods do not have an issue with that because they do not sync their recipes automatically but with JEI it would be mean if you had to reload it in the 2-3 digit range if everyone starts supporting/using that feature.

Mezz said he was planning a API for it. I think that was back in 1.14.4 i couldn't find it yet. (Honestly i was only a simple search through the API not through the implementation)

So is there a way or do i have to do force a JEI reload to get my "Synchronized" data to be seen by JEI?

Also just to point out: I can not move it to later since i rely on tags and Recipes to be loaded before me. Dependency issue. Yes even on the client.

commented

FWIW: I also have a related issue (for timing/tag-dependencies I think). In my case it's for custom ingredient serializers that use tags for matching. It's possible that JEI receives the tags synchronized event before my mod does, so my serializers return 'false' to JEI for matching against items in the tag as they don't believe it's safe to read tags (yes I have a mod-level latch that's flipped when a TagsUpdatedEvent.CustomTagTypes event occurs (basically doing what JEI itself is doing)...see VFP #issue-920444034 for why).

A "/reload" fixes the problem but that's not really a thing regular players would do. I kindof wish the 'ordering="AFTER"' in the mods.toml dependency descriptors actually did something; might help cases like this rather than having 20 mods trying to nudge JEI in some random way.

commented

Can only agree and having 20 mods throw the "JEI" reload trigger" by either directly calling it or throwing "TagsUpdatedEvent/RecipesUpdated" event to fake a reload for JEI is also not a solution since some mods just do not account for that problem. Like with CookingForBlockheads & Mantle just will straight out crash if i use this hack..
Actual Crash Report

A honest to god solution would be for JEI to throw a client side event that collects all possible mods that just have custom data send over and awaiting their completion. Its not like a custom Thread for just that couldn't exist. (Completable future would be the best for that)

And /reload is sadly not an option at all since every time a player logs in it has to be done and on servers you need admin rights to do that.

To add more this is not only a "JEI" issue but also a forge issue. Forge is technically not adding many ways to support such features with recipes etc. Thats one of the reasons a lot of modded recipe lists are still "hardcoded" on either side and not dynamically send to the client. There is no real "reload" trigger for that. (Talking about just custom recipe lists)

commented

This has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

commented

Fixed by forge