Thaumcraft

Thaumcraft

57M Downloads

[bug] thaumonomicon will not display some alchemy recipes

Frontrider opened this issue ยท 14 comments

commented

I wanted to make a research, where the recipe of the item changes as the user progresses forward (they get better at making it).

The research system looks fine with it, (easy to set up) but only the last recipe is registered.

I see it as the intended behaviour, so the crucible can work properly, but I think having multiple recipes for one item would be a good addition to expand the design space.

commented

Could you post your json and recipe registration code?

commented

The item registry name won't be unique either since it is the same item each time even if the nbt is different.

commented

Let's get back to it when I pushed. Gonna examine it a little closer. There might be something else there.

commented

I figured the actual problem, I was wrong. It just won't show up in the thaumonomicon, even though it will function properly. (the recipes show up in the thaumatorium)
They will also unlock properly.

This is the place, down until the end of the file.
https://github.com/Frontrider/thaumic_arcana/blob/eb2b981739e0117d39d51d81d1e0b49446c0d23e/src/main/java/hu/frontrider/arcana/registrationhandlers/recipes/AlchemyRecipes.kt#L433

It creates a set of recipes,that changes the nbt of the specified item. (the aspect list is associated with the nbt)

Tried adding a set of "fake" crucible recipes (that would actually be desireable in this case) but they will not show up either.

commented

It's also inconsistent since it works for some items, does not for others. Before this, I had just one item taking the aspects, then I used other methods to get this item, and that worked.

commented

The code is a bit hard to follow so I'm not 100% I am reading it correctly, but the resourcelocation you register a recipe as needs to be unique. From the look of it ResourceLocation(MODID, "ce_" + enchant.registryName!!.resourcePath) might not be unique?

commented

You're correct my repo is behind, and I did not have the time to push. (and you are reading it correctly)

That line got changed to include the name of the item, which makes it:
ResourceLocation(MODID, "ce_" + enchant.registryName!!.resourcePath+"_"+item.registryName!!.resourcePath)
(I made that change yesterday)

Gonna check my research file when I get home, but it does unlock when it the research is finished and is unavailable when the research is locked/unfinished.

commented

The research file:
https://github.com/Frontrider/thaumic_arcana/blob/1.12-dev/src/main/resources/assets/thaumic_arcana/research/biomancy/enchanting.json

After unlocking the first research, this shows up:
2018-09-20_19 34 50
there should be 4 more recipes bellow the green powder.
2018-09-20_19 34 34
This is what confused me, they show up in the thaumatorium, and craft properly, but not in the book.
2018-09-20_19 34 39
This recipe theoretically should be locked,since I never unlocked this red dust along the recipes. I can live with this behavior tough, and it would actually be desirable.
2018-09-20_19 34 57
Bad picture but I won't take an another one. Again, only the red dust shows up, but nothing else.
2018-09-20_19 35 08
2018-09-20_19 35 11
Same behavior, the recipes not showing up, yet cross-unlock.

The cross-unlocking recipes all have the same aspects.

commented

Sorry I forgot about this for another month :(
There seems to be some broken recipe resource locations in your json, for example: '"recipes": [
"thaumic_arcana:enchant_powder_basic",
"thaumic_arcana:ce_fertile"
],'

I guess that should be "thaumic_arcana:ce_fertile_enchant_powder_basic" ?

As for why it is not showing up in the thaumonomicon. My suspicion is that AlchemyRecipes line 437 the value of "enchant.research" is either the completed research or a reference to the next stage. I only show recipes that you have actually unlocked. For example In Metallurgy stage 1 you need to craft an alchemical brass ingot to proceed to the next stage. Thus the required research for that recipe is "METALLURGY@1"

commented

No prob. Until I have no way to go around it, I'm keeping the mod as experimental on curseforge.

I'll have to clean up some of that.

These lines are in dev, and not displaying:
"thaumic_arcana:ce_fertile_enchant_powder_basic",
"thaumic_arcana:ce_protection_enchant_powder_basic"

But, those lines also unlock:
"thaumic_arcana:ce_fertile_enchant_powder_advanced",
"thaumic_arcana:ce_protection_enchant_powder_advanced"
"thaumic_arcana:ce_fertile_enchant_powder_magical",
"thaumic_arcana:ce_protection_enchant_powder_magical"

Is there a way for me to inject research programmatically? I may try it that way, to make get rid of a "middleman", since all these recipes are generated dynamically.

Also, I think I want it to display with a "fake" recipe, but I could not figure how exactly that works.

commented

In short, a fake recipe is just a normal recipe, but for items with dynamic inputs (like salis mundus) I create a special implementation of the normal recipe. The fake recipe should not be registered as a real recipe since you probably don't want it craftable.
'ThaumcraftApi.addFakeCraftingRecipe(new ResourceLocation(Thaumcraft.MODID+":salismundusfake"), new ShapelessOreRecipe(defaultGroup, new ItemStack(ItemsTC.salisMundus),
new Object[] { Items.FLINT, Items.BOWL, Items.REDSTONE,
new ItemStack(ItemsTC.crystalEssence,1,OreDictionary.WILDCARD_VALUE),
new ItemStack(ItemsTC.crystalEssence,1,OreDictionary.WILDCARD_VALUE),
new ItemStack(ItemsTC.crystalEssence,1,OreDictionary.WILDCARD_VALUE) }));'

In theory the above could be used as a real recipe, but since I want the 3 crystals to be different I had to make write my own recipe code to check for that (sort of like vanilla dye recipes). That obviously does not play nice for display purposes so that is why I use the fake recipe above for display in the thaumonomicon.

commented

And the other question? is there a way for me to create a research from code?

commented

Can I inject fake alchemy recipes?