AppliedEnergistics / Applied-Energistics-2

A Minecraft Mod about Matter, Energy and using them to conquer the world..
https://appliedenergistics.github.io/
Other
1.44k stars 659 forks source link

Adding a recipe to the ME crafting terminal crashes from the server #4253

Closed CritFlaw closed 4 years ago

CritFlaw commented 4 years ago

The server crashes when attempting to add a recipe to the ME crafting terminal using the plus button in JEI

Describe the bug

See above

To Reproduce

Use the "Capital is Key" modpack (https://www.curseforge.com/minecraft/modpacks/capital-is-key)

  1. Use an energy accepter, cable, drive, 10 * 64k disks, no controller because channels are turned off, and an ME crafting terminal.
  2. Open the ME Crafting terminal.
  3. Search for a recipe in JEI (In my case, the Actually Additions small crate) and open the recipe in JEI.
  4. Click the + button near the recipe output.

Expected behavior

The recipe should be added to the ME crafting terminal assuming you have the resources, with the output displayed.

Additional context

https://pastebin.com/BE9Y3HJ4

Environment

Minecraft 1.12.2

Applied Energistics2 - appliedenergistics2-rv6-stable-7.jar

AE2 Stuff - ae2stuff-0.7.0.4-mc1.12.2.jar AE2 Wireless Interface terminal - AE2 Wireless Interface Terminal AE2 WIreless Terminal Library - AE2WTLib-1.12.2-1.0.34.jar Wireless Crafting Terminal - WirelessCraftingTerminal-1.12.2-3.12.97.jar Wireless Pattern Terminal - WirelessPatternTerminal-1.12.2-1.0.3.jar

JEI - jei_1.12.2-4.15.0.293.jar

Forge - 14.23.5.2847

yueh commented 4 years ago

Please report all autocrafting related bugs directly to your modpack.

Many are intentionally using AE2 addons, which will break autocrafting by design and tracking which modpack does or does not use them is simply not possible.

CritFlaw commented 4 years ago

I am the modpack author, and am reporting it to you

mindforger commented 4 years ago

you say it crashes, but there is no crash report

you seem to hit the network data limit for some unknown reason

try to add more details and reproduce the issue with a simpler setup (on a similar server-client setup) also add a forced crashlog for all included mod details and the recipe used to produce this (screenshots as far as possible)

CritFlaw commented 4 years ago

There is a crash report, it's in the link.

The steps are pretty clear, including the modpack used. I will try with a simpler setup.

Ommina commented 4 years ago

I see a portion of a stack trace; I don't see a crash report. Am I just not seeing a link somewhere?

yueh commented 4 years ago

This isn't a crashlog, just some excerpt from a logged warning or error.

Also there is no way for us to debug a whole modpack. It simply is too time-intensive and usually not even runnable in a dev environment. We pretty much rely on modpack authors to narrow it down to maybe 1-2 mods, which do cause it together.

As simple hint, it indicates that some packet sent between server and client is too large. No idea which it might be, but usually that's due to some recipe or itemstack having a massive amount of NBT data attached. Which usually means there isn't anything we can do about it, but have to rely on the mod or modpack adding the recipe/item to fix it.

CritFlaw commented 4 years ago

I will look into it but this is a local world, so it's the local server if that makes a difference. As for the recipe, it's an Actually Additions crate. Neither a complex recipe nor something with excessive NBT.

mindforger commented 4 years ago

looking at the recipe from the wiki i got to ask how many replacements for the chests are possible in your modpack ... i remember in older modded mc versions something similar could happen because of way too many wood options for vanilla chests (combining forestry, biomes o plenty and some barrel storage mod which name i forgot) caused by what @yueh said (to some recipe or itemstack having a massive amount of NBT data attached)

it could also simply be an issue of an overloaded me system updating too much content informations to your client (but i am unsure if AE2 has a limit on this

to add a forced chrashlog, hold F3 + c pressed until the game crashes

CritFlaw commented 4 years ago

That is a very useful bit of information thank you, I'll check on that. I do have an enormous amount of wood variants.

Ommina commented 4 years ago

https://github.com/mezz/JustEnoughItems/issues/1813 (and https://github.com/p455w0rd/JustEnoughEnergistics/issues/4 too, I guess) may also be useful.

CritFlaw commented 4 years ago

So an update to this. It doesn't happen with simpler recipes like the metallurgic infuser from mekanism. I didn't realize the crate could be so complicated because of the wood variants.

I removed AE2 Stuff, as well as all of Password's addons, tried with the crate again, and it does still happen. I'm not sure how to try with a simpler setup because it seems part of the problem is the amount of wood content in the pack, so I wouldn't know what the threshold would be.

I also have JustEnoughIDs in the pack and I don't know how that affects this situation. The JEI issue linked above seems the most relevant.

yueh commented 4 years ago

I don't think there is really a straightforward fix for it. Or at least in a way it's worth the effort. Ideally we would just send the recipe id over, but that is 1.13+ and I would bet on 1-2 mods deciding to break it completely and force everyone else to suffer under their decision. Forcing us to still transfer the whole ingredients list.

The easiest option would be to limit the possible ingredients. But that just asks for issues. I do not remember the list for each slot to be in a particular order. So as usually this would be a case for murphy and always skip the materials the player has stored and just send the unavailable ones. So not really an option.

One obvious solution might be to not send a full list for every single slot, but compile a single list of all ingredients and then indices for each slot. Not really a solution, but it might give a bit more room until it actually crashes.

CritFlaw commented 4 years ago

I don't have a clue how this works behind the scenes but is it possible to just use ore dictionary inputs for the recipes that support it, and let JEI handle that?

yueh commented 4 years ago

That's sadly not how JEI works. We only get the full exploded list of what fits into each slot. So if the oredict entry as 4000 entries, JEI passes all of them to us without any additional information.

Infering the oredict entry is also not really feasible. As just because all ingredients are planks, it does not mean that every oredict plank is still accepted. It might just accept vanilla planks.

The second option is also not feasible. Or actually useful. That is already happening at a different layer and most likely allows it to work in most cases. Would most likely make it even worse.

Pingger commented 4 years ago

I would bet on 1-2 mods deciding to break it completely and force everyone else to suffer under their decision. Forcing us to still transfer the whole ingredients list.

Just don't. Those 1-2 mods are at fault then and not AE2. But 2 mods right from the top of my head that are quite good in breaking the crafting system are IndustrialCraft2 and Mekanism ... But I haven't looked into how they changed their crafting handlers from 1.12 to the 1.13 ...

shartte commented 4 years ago

No. This is still present in all newer versions and actually results from mods adding so many item variants that the NEI packet exceeds the maximum packet size. Currently, the NEI packet will send all potential ingredients for each of the 9 slots in a 9 slot crafting recipe. Depending on the type of recipe and the ore dictionary content, this may result in a laaaaaaaaarge packet.

There's a solution now that recipe ids exist, but we'd still need to serialize something since our recipe transfer will prioritize the items that are currently shown in the NEI screen when you press the transfer button. So at least those need to be sent to the server on top of the recipe id.