Just Enough Items (JEI)

Just Enough Items (JEI)

392M Downloads

[1.16.4] Recipes not loading on servers

NielsPilgaard opened this issue ยท 6 comments

commented

It seems like the order that tags/recipes load when a client connects to a server is causing issues with loading recipes into JEI.

An example of this is that fluids do not show recipes they're used in when joining a server, however they show just fine in singleplayer. They also show after a /reload on servers.

Versions

  • jei-1.16.4-7.6.1.65
  • Forge-1.16.4-35.1.37

Example:

On a server
brine-mek usage not shown

On singleplayer, all usages, including 3 Mekanism machines, are shown properly.
brine-mek usage shown

Original issue: EnigmaticaModpacks/Enigmatica6#947
Report to Mekanism on Discord: https://discord.com/channels/554379889122213888/560583846509281280/801188918183723029

commented

can also confirm this behavour with some custom recipes in certain machines that use tags as inputs

commented

Honestly that sounds like the other mods are doing some form of weird caching in regards to what recipes the client side of that mod thinks exists or doing some custom syncing that takes place after JEI is loaded, so then when JEI asks it, it gives JEI the wrong recipes.

commented

Using 7.7.1.126 I have a similar problem, with some modded recipe added via JSON not showing in server play
If I open a Solo play first, then to go the server, custom stuff is visible.
Namely, trades added by Farming for Blockheads via MarketRegistry.json, but also trades by many other mods.
Might be a trade bug, any idea?
Already posted on Farming for Blockheads because I thought it was them, but other modded trade show the same, so

commented

For some reference about this, I believe it is probably related to the following:

  • When initially joining a server the sync order is Recipes, then Tags
  • When reload is ran, the order is tags then recipes.

JEI processing in the recipes updated event does not have all the information that recipes can "safely" expect to have exist when first connecting to a server. One way to fix this (though it would be messy and I am not sure if there is a better way around it):

  • If connecting to a vanilla server, don't run the initial scanning until after the TagsUpdatedEvent.Vanilla event has fired
  • If connecting to a forge server, don't run the initial scanning until after the TagsUpdatedEvent.Custom event has fired. This way if any custom type tags are used/needed they also have a chance to sync (as this event will fire after TagsUpdatedEvent.Vanilla), though this event never will be fired when connecting to a vanilla server
  • If single player, it can probably continue working as is, as during recipes the tag instances should be gotten form the TagCollectionManager which is static so can be reached across the sides (though it may be better to just act as if it was connecting to a forge server).
commented

I believe #2227 should in theory fix this so may be worth testing and if it does then closing this.

commented

This has indeed been fixed, thank you!