Smithing Table Crash w/ Armor Trims
WenXin20 opened this issue · 4 comments
Minecraft v1.19.2
Forge v43.2.7
Fast Suite v4.1.0
Armor Trims v1.3
The game occasionally seems to crash with the Armor Trims mod installed when clicking in the smithing table.
Crash Report
I was asked to report here by the dev: Hipposgrumm/armor-trims#21 (comment)
It is... interesting, to say the least, that it doesn't happen without armor trims, as based on the code paths I would expect it regardless.
But based on the crash report this is actually a Placebo issue that may be fixable through use of ConcurrentHashMap over HashMap
Try with this Placebo jar to see if it fixes it (This is a jar in a zip because github doesn't allow uploading jars directly)
Placebo-1.19.2-7.2.1+C.jar.zip
Wait, it requires PlaceBo?
Well that’s why I couldn’t find anything when digging through the code.
But I think the problem might have to do with the fact that my recipes use hardcoded algorithm that trims the armor but also uses the vanilla recipe managers to determine the netherite upgrading and other json recipes based on the vanilla smithing table.
Another thing (that probably isn’t related to the current issue) is that I use regular HashMaps, and l will continue to until someone tells me the difference.
Well this particular crash did - it was caused by FastSuite multithreading the smithing recipes, which Apotheosis uses for socketing. Socketing triggers an affix lookup, which is cached on a HashMap in the itemstack - then ConcurrentModificationException shenanigans.
Still not sure where armor trims comes into play, tbh. This issue should present with the vanilla smithing table as well. Maybe it does recipe lookups differently (as it looks like you replace it).