Azanor / thaumcraft-beta

Location for Thaumcraft beta testers to report problems, suggestions and errors.
MIT License
139 stars 103 forks source link

[Bug] Basic Recipe Issue in Thaumcraft causing potential removal of aspects with any mod #1619

Open Dragnier opened 5 years ago

Dragnier commented 5 years ago

The mod Vanilla Food Pantry is not a Thaumcraft Addon in any way and yet somehow with only it, Thaumcraft, and JEI, the Gelum Aspect is being removed from Snow items. The author of the mod does not seem to be able to figure out what is causing the issue.


https://github.com/Wabbit0101/mods_hoardercraft/issues/40#issuecomment-389163210

VFP doesn't do anything with definitions or recipes for snowballs or snow and it has no explicit integration for thaumcraft. It does have recipes that use snowballs and snow...but why that would affect thaumcraft I don't know. (I confirmed also missing other stuff like oak logs, planks, etc....weird)

Don't have any suggestions for you other than perhaps try to isolate to verify it's just these two specific mods. To VFP snowballs are a minecraft object like sticks, with no significance (or changes) to that object.

I am curious if someone more knowledgeable might be able to figure out what is going on.

Lohoydo commented 5 years ago

this has been an issue in certain beta builds of thaumcraft. Are you using the newest build? and if you remove VFP (leaving just thaumcraft and jei) does the gelum return?

Dragnier commented 5 years ago

Yes, removing VFP fixes the issue. I was asking if anyone could help the author of that mod since they have tried to fix it without any luck. They do not touch snow at all other than to use it as an ingredient. Yet somehow, when VFP and Thaumcraft are together the Gelum goes away.

Wabbit0101 commented 5 years ago

I have been able to isolate this issue outside of VFP to just Thaumcraft and a simple test mod. The snow aspects seem to get stomped on by Thaumcraft in response to a particular kind of recipe. I also notice, depending on recipe combinations, other aspects (like oak related items) are stomped on also. The attached sample is reduced to only affecting snow/snowballs. Attaching both a small jar of the testmod and its source for reference. Hope this helps; let me know if I've missed any information you need.

Maybe unrelated: The tooltips for weapons are also messed up.

testmod-issue1619-package.zip testmod-minecraftlog.txt

Test environment: Java is version 1.8.0_201, using 64-bit architecture (Windooze) Forge Mod Loader version 14.23.5.2768 for Minecraft 1.12.2 loading Baubles-1.12-1.5.2 jei_1.12.2-4.14.3.237 testmod-1.12-001 Thaumcraft-1.12.2-6.1.BETA26

tterrag1098 commented 5 years ago

After a night of debugging I have isolated the cause to this issue. Your test mod adds an alternate recipe for cake, which Thaumcraft assigns "complex" aspects to (meaning it searches through all recipes for that item to compute the aspects). Your alternate recipe requires a custom item, which itself requires snow, which can be crafted with snow blocks.

This seems innocent enough, but the issue is subtle. When aspects are computed from recipes, they are registered to whatever damage value the recipe specifies, in this case 0. But when done manually, Thaumcraft uses the magic "wildcard" damage, 32767. Still, the issue is not clear.

The bug comes from two aspect registrations now existing for snowballs. One using damage 0 (which is empty) and one using damage 32767 (which contains Gelum). When Thaumcraft looks up aspects, it starts with the exact meta passed in (always 0 for snowballs) and only if that returns null it falls back to trying 32767. So by adding those recipes you effectively overwrite the snowball aspects.

This is absolutely a Thaumcraft bug, but a workaround (for VFP and other mods causing this) I believe would be to register snowballs to the oredict with the wildcard value damage, and use that oredict in the recipe.

As for fixes in thaumcraft, there are two options I see. One would be to change recipe scanning to register aspects to the wildcard damage when Item.getHasSubtypes() == false. As any item that returns false from that will ignore damage values for all purposes, it is effectively a wildcard.

The second is to prefer the wildcard value when looking up aspects, but this has the potential to break in the opposite way. Honestly the bug is rather core to the whole design of the aspect registry, and there is no simple and perfect fix.

tterrag1098 commented 5 years ago

After a night's sleep and a fresh mind, I realize the fix may be simpler. Thaumcraft should simply not register empty aspect lists. If the code checked for null and skipped registering if no aspects were found, it would behave identically for items that really do have no aspects, and fix the issue with overwriting those that do.

grundyboy34 commented 5 years ago

Hi @tterrag1098 , your fix works great and was much needed for my pack. I was wondering, would you consider uploading it or allowing me to upload it to curseforge so it can be included easily into packs there? EDIT: For people looking for tterag's fix. Since the last link to the fix jar was dead, you can just go here to find the latest. http://assets.tterrag.com/

xJon commented 4 years ago

Any expected fix for this apart from tterag's fix which is not available through CurseForge?