Polymorph (Fabric/Forge/Quilt)

Polymorph (Fabric/Forge/Quilt)

99M Downloads

[1.18.2] Button in the Smithing Table

INooBTooMuch opened this issue ยท 14 comments

commented

The polymorph button is in the smithing table.
This is a mod compatibility issue I believe because it doesn't show up in a world with just Polymorph.
name
(This also appears when installing a gem into an Apotheosis weapon I don't know whether it is handled differently)
2022-08-21_12 01 22
(when hovering over the item this appears)
2022-08-21_12 01 23

commented

Which mods are causing the incompatibilities specifically? Is it just Apotheosis?

commented

I'm not sure about it, but these are the Mods
I tested it with Enlightened End, Majrusz's Progressive Difficulty, Oh The Biomes You'll Go, Forbidden and Arcanus and its there but not as buggy as with Apotheosis items (not just the gems but the affixed items)

commented

I've tried with ATM8 and Direwolf20 1.19, no bugs. However, I was able to get something from an Enigmatica 8 instance. I do at least see the Polymorph button now with the sole output selection, although the recipe is still working and craftable. I'll try to work with this and see what I can glean from it.

commented

This issue is very prevalent with apoth's socketing system. I'm at a loss as to why it is occurring. The recipe class in question is here https://github.com/Shadows-of-Fire/Apotheosis/blob/1.18/src/main/java/shadows/apotheosis/adventure/affix/socket/SocketingRecipe.java

Its to the point where I have users reporting that it doesn't work at all. The proper output cannot even be selected, and no output is produced (so polymorph is just breaking this recipe entirely).

More confusingly, users report that it works if and only if they restart the world, and then place the item in before the gem. It seems like placing a gem in the right slot with an empty left slot is causing polymorph to soft-lock the recipe until a restart.

commented

Thanks for the info, I'll look into this today and hopefully find out what's going on. If something is breaking another mod's recipe then this is a serious issue and I'll try to have a fix out as soon as possible.

commented

@Shadows-of-Fire Have you been able to reproduce this and/or have a list of steps to reproduce the issue? I've looked at the code and I'm not entirely sure why this is occurring either, and I cannot get this behavior on my end in my testing environment so I am at a bit of an impasse currently.

commented

I don't think I've seen anyone reporting it outside of usage in modpacks - I do believe I've seen reports out of E8, ATM8, and even Direwolf 20 1.19 now, but I'm not sure if anyone has drilled it down to isolation. I'll ask about and see if anyone has.

commented

I was able to get someone to trip the issue with the following reproduction steps:

Have a socketable item and any gem in inventory:

  1. Shift click the item into the slot.
  2. Shift click the item out of the slot.
  3. Shift click the gem into the slot.
  4. Shift click the gem out of the slot.
  5. Place both items into the correct slots from the inventory.
  6. Observe recipe failure - The polymorph button will show the "real" output but be unselectable for some reason.
commented

Alright thanks, sounds good. I'll try a few different avenues in the meantime, including testing in some of those modpacks specifically to see if I can reproduce it there.

commented

Hm, still nothing on my end with that unfortunately. Do you know what modpack they were using?

commented

Custom for that user, I can ask for the list

commented

Scratch that, their mod list is in the 600's, so that won't be useful.

commented

I think I have a pretty good idea on what's going on now.

One issue I've discovered is that Placebo, the Apotheosis dependency, runs this piece of code client-side only (at least in single-player). I don't know enough about the code involved to know why the main recipe map remains synced, but the byName map gets desynced and all the recipes are only available on that map from the client. I've verified this because the difference between the sizes on each side is exactly the amount that Placebo logs that it adds. This is an issue because Polymorph uses the byName map server-side to validate and quickly retrieve recipes based on their ID. This explains why players cannot select the proper output since the socketing recipe is missing from that map on the server.

Another issue is that it seems like certain mods, Alex's Mobs in my test instance, are matching their recipes to any input and simply returning an empty output to represent an invalid state. This will not only cause Polymorph to incorrectly surmise that there are multiple recipes when there is practically only one (causing the button to appear erroneously), but it also causes Polymorph to cache a recipe that will only ever have an empty output.

Taking these two into account, I believe what's happening is:

  1. Player places an input that does not match the socketing recipe
  2. The input matches with a "universal" recipe - a recipe that a mod has coded to match with anything
  3. Polymorph selects and caches the universal recipe
  4. Player places an input that does match the socketing recipe
  5. Polymorph sees two total recipes, the universal one and the socketing one.
  6. Polymorph outputs the cached recipe, the universal one, which returns empty and lists the socketing one as a selection
  7. Selecting the socketing one is invalidated server-side because of a missing key

While some of these issues will need to be addressed on the corresponding mod's end in one shape or another, I will need to at least address excluding erroneous recipes from Polymorph's processing.

commented

Interesting that I have been breaking the byName map for so long unknowingly. You would think that would have had major consequences.

I'll see how far back that's an issue and fix it in placebo