Nomifactory / DimensionalEdibles

Travel through dimensions with food!
https://www.curseforge.com/minecraft/mc-mods/dimensional-edibles-omnifactory-edition
GNU Lesser General Public License v3.0
3 stars 6 forks source link

Dimension compatibility problems with JED #22

Closed Exaxxion closed 3 years ago

Exaxxion commented 3 years ago

JED registers its dimensions extremely late in the loading process, which currently causes problems with our config loading and cake registration model. It isn't until the server is actually started that the dimensions appear, which is well after Forge registries have been locked.

For custom cakes, we currently guard against registering cakes for dimensions which are not reported as existing during the PreInitialization phase where mods load their configs. This is why we used to get those strange "119 is not a number" log spam in Omnifactory intermittently during initialization, and why we had to forcibly register our Void Cake with JEI.

I propose that in the interest of better supporting JED, we should move the check for whether a dimension exists from the Forge initialization lifecycle event handlers (where we load configs and register our items/blocks) to the Cake's onBlockActivated handler, which would have the effect of registering the cakes anyway and just preventing players from using them if the target dimension doesn't actually exist.