Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Dragnier opened this issue Jan 11, 2019 · 7 comments

Comments

@Dragnier
Copy link

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.


Wabbit0101/mods_hoardercraft#40 (comment)

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
Copy link

Lohoydo commented Jan 22, 2019

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
Copy link
Author

Dragnier commented Jan 23, 2019

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
Copy link

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

@Dragnier Dragnier changed the title [Compat Help] Vanilla Food Pantry [Bug] Basic Recipe Issue in Thaumcraft causing potential removal of aspects with any mod Feb 7, 2019
@tterrag1098
Copy link

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
Copy link

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
Copy link

grundyboy34 commented Sep 1, 2019

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
Copy link

xJon commented Oct 31, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants