Applied Energistics 2

Applied Energistics 2

156M Downloads

AE2/Mekanism crafting error wants to be reported

syndran opened this issue · 12 comments

commented

Attempting to craft induction recipes (provider and cell) from mekanism that use the tier below, cause these errors to occur in server console. attempting to complete the craft on higher tiers will result in overtick and server shutdown.

with Ore dictionary/substitution on or off. (off will result in total recipe failure for some). attempt the craft an advanced, elite or ultimate induction cell or provider from mekanism

expected. substitution picks up the basic/advanced/elite item and includes in recipe without error

Error Log
https://pastebin.com/QLKgnw7N

Pack - ATM3
Applied Energistics 2 rv6-stable-3
Mekanism 1.12.2-9.4.13.349
Forge Mod loader 8.0.99.99

commented

Mekanism was the issue we added the logging as their recipes and items are inherently designed to be extremely ambiguous, therefore causing these problems. But as long as they don't fix it, there is nothing we can do about it besides warning about it.

commented

@yueh what on earth do you mean by "ambiguous"? Those recipes are NBT sensitive (to one particular tag; the tier)

If you're just comparing the item and complaining when it doesn't work, thats on you.

commented

Would it be possible to "solve" the server crash issue by disabling AE logging ? if so, how would one do that ?

commented

OK, so I did a little more checking. This is 100% your issue @yueh because you expect the NBT to be exactly the same as the recipe definition. It won't be in many cases. This cannot change due to the fact that the recipes preserve energy stored & ownership information.

commented

You simply overlook the broader issue about it. NBT is just arbitrary data without any semantic for an external user. There is simply no way to determine, if an entry is important as it's defining a item type/variant or if it could be dropped because it's just irrelevant data.

Either we'd have to provide a special case for every mod out there or forge has to provide a common way to obtain these informations.

And neither will be done (most likely). I do not plan to introduce special cases for some mods and have to track them in case they decide to break something again. It is simply not worth the effort.

Forge probably won't introdude something similar. Mostly because it's already provided by minecraft itself. Just use different ids or metadata to differentiate different types like most other mods out there.

If you decide to break these conventions, don't complain when other mods refuse to follow it.
Especially as it's probably the worst possible one in terms of performance.

commented

Your system would still reject the output item in some cases, as the NBT for the energy stored might not match 100%, as you're expecting.

And its certainly not possible to just up and change how an item gets stored mid-minecraft-version.

commented

Yes, because your items are one of the reason why we have to do it. But then that is a completely different point and has absolutely nothing to do with the initial report.

commented

Well the recipes accept the valid items. If you cant write code to pick the correct item to insert, ¯\(ツ)

commented

It is pretty pointless to discuss this any further as you do not really understand what the actual issue is.

commented

So you'll just nope out of it by ridiculing instead of explaining? *slow clap*

commented

Let's hope you can comprehend it.

Basically there are 2 ways for crafting with existing items. One will pick the exact item, it's fast, does not randomly pick unwanted alternatives and so on. The other will be more fuzzy and ignore NBT, take oredict into account and so on.

With mekanism and the second we simply have a mekanism:generic_energy_item. So it will take every variant of it into account, stick it into the recipe and hope it will work. Of course mekanism will reject this particular item due to being the wrong type. What now happens is that some mods like mekanism decide it's a great idea to have multiple recipes for the same item, we have to query the forge recipe system. Which will match the input against every existing recipe out there. Which simply takes a while with hundreds or thousands of recipes. Just to have it fail, because there is no alternative recipe.
Skip to the next variant of mekanism:generic_energy_item and repeat.

Have a shitton of them stored and it will simply scale as badly as it sounds. And that is why we log everytime it has to use the fallback. Because it is a massive performance issue. Not just for AE2, but can easily apply to any other crafting machine or even some of the "smarter" crafting tables.

So we can pick the correct item. We just have to iterate through every similar item. With 1.13/1.14 I will throw out the fallback handling and it will be one recipe per pattern. The warning are just in the hope that other mods might consider a better approach in terms of performance, less overhead, and even be better in picking actual alternatives. Especially with item flattening in 1.13. Hopefully mods will move to mod:some_actual_item_variant as id and mod:item not abuse NBT for different types. But I totally expect some mods to not give a fuck about it and make it worse for everyone else.

commented

like mekanism decide it's a great idea to have multiple recipes for the same item

Such as? This case doesn't seem to apply here from what I saw in the log, given it wouldn't have found an alternate with the other ingredients