Polymorph (Fabric 1.16.1 - 1.19.2)

Polymorph (Fabric 1.16.1 - 1.19.2)

12M Downloads

[fabric] Polymorph does not appear to be working with smithing table right now.

dehen opened this issue ยท 2 comments

commented

Versions (Be specific, do not write "latest"):

  • Polymorph:polymorph-fabric-0.45.0+1.19.2
  • Forge/Fabric:fabric 14.10 + fabric-api-0.64.0+1.19.2

Observed Behavior:

No polymorph button in smithing table for duplicate recipes.

Expected Behavior:

So I added several recipes with crafttweaker that just give me named variants of a netherite sword. The crafttweaker recipes appear in REI but I don't get a polymorph button in the smithing table, which I would expect. My craft table recipes do work.

Steps to Reproduce:

  1. Minimal modset to test might be polymorph+crafttweaker+ingredientextensionapi+fabricapi+rei
  2. Add crafttweaker_crafting_recipes.zs under [minecraftroot]/scripts
  3. Try to upgrade a diamond sword, no polymorph button. I would expect a polymorph button like you see when you try to make a diamond sword.
  4. As follow-up, you can check REI recipes and they're parsing because you can see several variants if you click the netherite sword smithing recipes.
commented

That's fair. Thanks for doing the testing. At least it helped find a parsing issue.

commented

It took me quite a bit of testing to figure out what was going on in this scenario in its entirety. Polymorph was not parsing the tag data correctly, which resulted in it seeing all of the different outputs as a singular one. After making some corrections, I was able to get the selection menu to appear properly.

However, selecting the outputs did not actually change the crafting result. I found out that this is because the Smithing Table overrides all tags in the result with the original item. Since you're putting a Diamond Sword in as an ingredient, the damage tag that is innate to all damageable items will override any custom tags you try to put onto the output. This ultimately means your smithing recipes will not work as intended simply due to vanilla code.

I'll fix the parsing issue mentioned above, but addressing the recipe problem is outside the scope of this mod.

Edit: The above issue can be tested without interference from Polymorph by adding to the script:

smithing.addRecipe("test_recipe", <item:minecraft:netherite_sword>.withTag({display: {Name: "{\"text\":\"Netherite Tester\"}"}}), 
  <item:minecraft:iron_sword>, 
  <item:minecraft:slime_ball>);

This is a unique recipe so the output should always include the tag but it doesn't and appears only as a regular Netherite Sword.