Thaumcraft Fix

Thaumcraft Fix

23.3k Downloads

Error in log with IC2 Classic + Thaumic JEI

xJon opened this issue ยท 8 comments

commented

https://mclo.gs/83IX6kD

Might already be resolved by Thaumcraft Fix, and originally reported over TinyModularThings/IC2Classic#1151. I still figured to document it here, although it currently has a workaround implemented by @Speiger for the latest version of IC2C, who said it is a Thaumcraft bug:

Basically they call: getRemainingItems without calling matches first.
That put the recipe into an invalid state causing the crash.
Note if matches returns false then it shouldn't be calling getRemainingItems either.
It's a vanilla interface.
For crafting recipes.

commented

@TheCodex6824 yeah in ic2cs case we are caching the offset of the result that ShapedRecipe also uses for the matches function.
That cache is used for stackcrafting to ensure the correct items are used by the recipe.

commented

Looks like the original thinking was probably that all of the input ingredients get copied into a fake crafting inventory before calling getRemainingItems so it's safe. Unfortunately, this doesn't work for dynamic recipes (which I'm guessing is what that recipe with error was) because they don't have a static list of ingredients to return in their recipe.

The arcane workbench fix included with this mod fixes a similar issue with the workbench handling vanilla crafting recipes, but it's a different issue than this instance.

commented

I believe 3ae4352 resolved this, and the issue can be closed?

commented

It should fix it but i would test it first

commented

@Speiger I have tested with IC2 Classic version 1.5.9 (pre-workaround) and there's still no error in the log when Thaumcraft Fix is present ๐Ÿ‘

commented

Right, that commit should have fixed it. We also won't proceed now if matches returns false.

Not related to IC2 Classic, but you might want to check aspects on your items - as part of this fix I had to fix how Thaumcraft inserted the items into the fake crafting grid because it was wrong for recipes that didn't take up the full 3x3 grid. I think I have everything correct with that, but please double-check my work there.

commented

@TheCodex6824 Are there any specific items to check the aspects for?

commented

@TheCodex6824 Are there any specific items to check the aspects for?

I have to get around to writing automated tests for this mod at some point so we don't have to worry as much about these things, but these kinds of items should cover the different things that can happen:

  • Normal crafting item that takes up entire grid (like chest - as long as it needs 3 width and 3 height, empty spaces in a single slot don't matter)
  • Normal crafting item that doesn't take up entire 3x3 area (sword, slabs)
  • Arcane crafting items, same as above 2 cases. Include some that do and do not take crystals as well.
  • "Dynamic" (code-based) recipes, that do not have a set ingredient list. These are different from the IC2 Classic recipes in this issue - the recipes I'm talking about would be some of the TA augment recipes for example. In theory, these should not have been counted both before and after these changes, but it might be possible for one of these recipes to return bogus ingredients, which will now not generate aspects after these changes.

If you do find an issue, you should probably open a new issue so we don't keep spamming Speiger :)